DataSource (Discovery)
Applies To: Operations Manager 2007 R2, System Center Operations Manager 2007
Represents an implementation of a data source module type definition.
Schema Hierarchy
ManagementPack
Monitoring
Discoveries
Discovery
DataSource (Discovery)
Syntax
<DataSource ID=”ModuleID” Comment=”Comment” TypeID=”ModuleTypeID”>
Custom Schema Defined Parameters
</DataSource>
Attributes and Elements
The following sections describe attributes, child elements, and the parent element of the DataSource element.
Attributes
Attribute | Description |
---|---|
ID |
Required attribute. Represents the identity of the element. |
Comment |
Optional attribute. Represents commentary by the management pack author. |
TypeID |
Required attribute. Represents DataSource module type definition from which this DataSource module inherits its configuration schema. |
ID Attribute Values
Value | Description |
---|---|
The format for the ID attribute should be |
The ID string must contain the following characteristics:
|
Child Elements
The child element of the DataSource module is defined by the Configuration (DataSourceModuleType) schema of its base type as referenced in the TypeID attribute.
Parent Elements
Element | Description |
---|---|
Defines a workflow that returns discovery data for class and/or relationship type instances. |
Remarks
Because a data source module does not take an input stream, it must always be the first module in any workflow. The data source module initiates the workflow, functioning entirely or partially as a scheduler or functioning as an event provider. The data type of its output data is defined in its OutputType (ConditionDetectionModuleType) element.
A data source module type never alters system state. If you want a module to affect system state, you must instead use or implement a WriteAction (WriteActionModuleType) module.
A data source module’s base type must always be a descendant of a DataSourceModuleType type.
When a data source module is used in a discovery, it must always return a System.Discovery.Data type.
Example
The following sample illustrates how a Discovery element encapsulates a data source module named Microsoft.SQLServer.2008.DBDiscovery
. The data source module of type Microsoft.SQLServer.2008.DBDiscovery
internally uses script to return System.Discovery.Data at a timed interval. The definition of the data source module is provided below the discovery sample. For more information about the variable notation used in this sample, see $Target and $Config. For more information about a how to write discovery scripts, see How to Create Discovery Data Using a Script.
<Discovery ID="Microsoft.SQLServer.2008.DatabaseDiscoveryRule" Enabled="true" Target="Microsoft.SQLServer.2008.DBEngine">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="Microsoft.SQLServer.2008.Database">
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="DatabaseName" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="RecoveryModel" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="DatabaseAutogrow" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="DatabaseSize" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="DatabaseSizeNumeric" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="LogAutogrow" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="Updateability" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="UserAccess" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="Collation" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="LogSize" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="LogSizeNumeric" />
<Property TypeID="SQL!Microsoft.SQLServer.Database" PropertyID="Owner" />
</DiscoveryClass>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.2008.DBDiscovery">
<IntervalSeconds>7200</IntervalSeconds>
<SyncTime />
<ComputerID>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerID>
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<SQLConnectionString>$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ConnectionString$</SQLConnectionString>
<SQLInstanceName>$Target/Property[Type="SQL!Microsoft.SQLServer.ServerRole"]/InstanceName$</SQLInstanceName>
<ExcludeList />
<TimeoutSeconds>300</TimeoutSeconds>
</DataSource>
</Discovery>
…
<DataSourceModuleType ID="Microsoft.SQLServer.2008.DBDiscovery" Accessibility="Internal" RunAs="SQL!Microsoft.SQLServer.SQLDiscoveryAccount">
<Configuration>
<xsd:element name="IntervalSeconds" type="xsd:integer" />
<xsd:element name="SyncTime" type="xsd:string" />
<xsd:element name="ComputerID" type="xsd:string" />
<xsd:element name="ComputerName" type="xsd:string" />
<xsd:element name="SQLConnectionString" type="xsd:string" />
<xsd:element name="SQLInstanceName" type="xsd:string" />
<xsd:element name="ExcludeList" type="xsd:string" />
<xsd:element name="TimeoutSeconds" type="xsd:int" />
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" ParameterType="int" Selector="$Config/IntervalSeconds$" />
<OverrideableParameter ID="SyncTime" ParameterType="string" Selector="$Config/SyncTime$" />
<OverrideableParameter ID="ExcludeList" ParameterType="string" Selector="$Config/ExcludeList$" />
<OverrideableParameter ID="TimeoutSeconds" ParameterType="int" Selector="$Config/TimeoutSeconds$" />
</OverrideableParameters>
<ModuleImplementation>
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
<ScriptName>DiscoverSQL2008DB.vbs</ScriptName>
<Arguments>$MPElement$ $Target/Id$ $Config/ComputerID$ $Config/ComputerName$ $Config/SQLConnectionString$ $Config/SQLInstanceName$ "Exclude:$Config/ExcludeList$"</Arguments>
<ScriptBody>
<![CDATA[
‘Discovery script to return discovery data goes here.
]]>
</ScriptBody>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</DataSource>
</MemberModules>
<Composition>
<Node ID="DS" />
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>