Database MP Phase II

I decided to add database discovery to the MP.  The attached MP is an expansion of my prior post.

Start by creating a database to hold information about the objects.

And fill it with some rows

Next create a new custom datasource

Note in particular that the Query used the OleDB module, and the ClassId and InstanceSettings used by the Mapper are passed as parameters.  This allows you to reuse the datasource with lots of different discoveries where each discovery only has to know its database query, classtype, and the mapping between the two.

Next, create a class that we’ll discover with a database query.

Next, create a discovery using the datasource.

Here’s the XML for the Configuration:

<Configuration p1:noNamespaceSchemaLocation="C:\Documents and Settings\Administrator\Local Settings\Temp\DBMP.DiscoverMyClass.xsd" xmlns:p1="">
  [ID] as [1],
  [Description] as [2],
  [Color] as [3],
  [AlcoholContent] as [4]
  from ObjectTable
        <Value>$Data/Columns/Column[3]$ object number $Data/Columns/Column[1]$ </Value>


Note the embedded SQL Query and mapping details. 

I added a column to the MessageLog table called ItemID to act as a foreign key to the the ObjectTable table.  I also added a rule to the attached MP targeting the discovered objects from the database, and monitoring the MessageLog table.  So now the objects are described and stored in the database, and the health data about those objects also comes from the database.  I’ve also posted the SQL code to create the database, but you’ll have to stick some data in it.

Please let me know if this is useful. 


This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s