Share via


DataSource (Rule)

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
    Rules
      Rule
        DataSources
          DataSource (Rule)

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 the 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 UniqueElementID.

The ID string must contain the following characteristics:

  • The length is less than or equal to 256 characters.

  • The ID begins with a letter (a-z) or a number (0-9).

  • The ID contains only letters, numbers, the period character (.), or the underscore (_) character.

  • The ID is unique across all of the elements within the scope of the DataSource module’s containing workflow.

  • The ID is case-sensitive.

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

DataSources

Contains one or more data source modules.

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 either in virtue of functioning either entirely or partially as a scheduler or as a data provider. As a data provider, the data source can get data from NT performance counters, SNMP triggers, or NT events. 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.

Example

The following XML sample illustrates a rule that runs wmiadap.exe once a day. This workflow consists of a data source module and a write action module.

<Rule ID="Microsoft.Windows.Server.2008.Computer.RunWMIAdap" Enabled="false" Target="Server2008!Microsoft.Windows.Server.2008.Computer">
  <Category>Maintenance</Category>
  <DataSources>
    <DataSource ID="Scheduler" TypeID="System!System.Scheduler">
      <Scheduler>
        <SimpleReccuringSchedule>
          <Interval Unit="Days">1</Interval>
        </SimpleReccuringSchedule>
        <ExcludeDates />
      </Scheduler>
    </DataSource>
  </DataSources>
  <WriteActions>
    <WriteAction TypeID="System!System.CommandExecuter" ID="DS1">
      <ApplicationName><![CDATA[%windir%\system32\cmd.exe]]></ApplicationName>
      <WorkingDirectory />
      <CommandLine>/c wmiadap.exe /F</CommandLine>
      <TimeoutSeconds>300</TimeoutSeconds>
      <RequireOutput>true</RequireOutput>
      <Files />
    </WriteAction>
  </WriteActions>
</Rule>

The second sample demonstrates a rule whose workflow runs a counter on the target’s host (a Windows-based computer) either when five minutes have elapsed and the counter has a change delta of 1 or when an hour has elapsed with no change to the counter. If data is retrieved by the data source module, the performance data is then committed both to the Data Warehouse and to the Operations Manager database.

For more information about the data source module in this sample, see System.Performance.OptimizedDataProvider.

The data source module uses $Target/Host and $Target/Property notation to retrieve contextual data from the rule’s target, Microsoft.Windows.Server.2008.LogicalDisk. For more information, see $Target.

<Rule ID="Microsoft.Windows.Server.2008.LogicalDisk.AvgDiskQueueLength.Collection" Enabled="onStandardMonitoring" Target="Server2008!Microsoft.Windows.Server.2008.LogicalDisk">
  <Category>PerformanceCollection</Category>
  <DataSources>
    <DataSource ID="PerformanceDS" TypeID="SystemPerf!System.Performance.OptimizedDataProvider">
      <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
      <CounterName>Avg. Disk Queue Length</CounterName>
      <ObjectName>LogicalDisk</ObjectName>
      <InstanceName>$Target/Property[Type="Windows!Microsoft.Windows.LogicalDevice"]/DeviceID$</InstanceName>
      <AllInstances>false</AllInstances>
      <Frequency>300</Frequency>
      <Tolerance>1</Tolerance>
      <ToleranceType>Absolute</ToleranceType>
      <MaximumSampleSeparation>12</MaximumSampleSeparation>
    </DataSource>
  </DataSources>
  <WriteActions>
    <WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData" />
    <WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData" />
  </WriteActions>
</Rule>

See Also

Reference

DataSourceModuleType
DataSources