$Data
Applies To: Operations Manager 2007 R2, System Center Operations Manager 2007
Workflows pass data items from module to module. The format of each data item is an XML fragment. The $Data notation variable represents this data as an XPath expression.
$Data/NameofValue$
Remarks
During discovery of the data that is gathered from a data source, the $Data variable can be used to map data to the properties of the Management Pack element that is being discovered. To map this information, you must use both the $MPElement variable and the $Data variable. The $MPElement variable retrieves the assigned GUID of a property, and the $Data variable provides a value to the property.
Syntax Section | Description |
---|---|
$Data |
Refers to a property within the DataSource element. |
Name of Value |
Path to the data that was retrieved by the DataSource element. |
Example
In the following example, a rule is defined. The DataSource element retrieves data by using the computer discovery module type. In the ConditionDetection element, the data retrieved is used to populate an FQDN property. In the Setting element, variables are used so that the FQDN property is created for every object that is discovered. The Setting element, a child element of the ConditionDetection element, defines a name and value for each discovered object. The Name element uses the $MPElement variable to retrieve a GUID to use as a name for the new property. The $Data variable retrieves a value that was gathered in the data source module and assigns it to the new FQDN property.
<Rule ID="DiscoveryRule" Target="RHS" Enabled="true">
<DataSources>
<DataSource ID="DS1" TypeID="System.ComputerDiscoveryDS">
<Interval>5000</Interval>
<Verify>false</Verify>
<Domain>ntdev</Domain>
<Query><![CDATA[(&(objectClass=computer)(cn=username*))]]></Query>
</DataSource>
</DataSources>
<ConditionDetection ID="CD1" TypeID="System.DiscoveryDataMapper">
<DiscoverySourceType>0</DiscoverySourceType>
<DiscoverySourceObjectId>$MPElement$</DiscoverySourceObjectId>
<DiscoverySourceManagedEntityId>$Target/Id$</DiscoverySourceManagedEntityId>
<InstanceType>0</InstanceType>
<InstanceTypeId>$MPElement[Name="System!Windows.Computer"]$</InstanceTypeId>
<InstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="System!Windows.Computer"]/FQDN$</Name>
<Value>$Data/FQDN$</Value>
</Setting>
</Settings>
</InstanceSettings>
</ConditionDetection>
<WriteActions>
<WriteAction ID="WA1" TypeID="System.ProcessDiscoveryData" />
</WriteActions