Share via


Discovery

Applies To: System Center 2012 - Operations Manager, System Center 2012 R2 Operations Manager, System Center 2012 SP1 - Operations Manager

Defines a workflow that returns discovery data for class and relationship type instances.

Schema Hierarchy

ManagementPack
  Monitoring
    Discoveries
      Discovery

Syntax

<Discovery ID=”DiscoveryID” Comment=”CommentID” Enabled=”True/False” Target=”TargetEntityID” ConfirmDelivery=”True/False” Remotable=”True/False”>
   <Category>CategoryName</Category>   <DiscoveryTypes>…</DiscoveryTypes>
   <DataSource>…</DataSource>
</Discovery>

Attributes and Elements

The following sections describe attributes, child elements, and the parent element of the Discovery element.

Attributes

Attribute Description

ID

Required attribute. Represents the identity of the element. To learn how to identify your element in a management pack, see Element Identity and Namespace Conventions.

Comment

Optional attribute. Represents commentary by the management pack author.

Enabled

Required attribute. Defines whether or not this workflow is by default enabled or disabled.

Target

Required attribute. The ID of the targeted class type.

ConfirmDelivery

Optional attribute. Defines whether or not the module following the data source module will notify the data source that it has received the data. Applies only to discoveries that contain data source modules with more than one member module. The default value is false.

Remotable

Optional attribute. Defines whether or not this workflow will run for agentless monitoring. Default value is true.

Enabled Attribute Values

Value Description

True

The workflow is enabled and will run when its target class has been discovered.

False

The workflow is disabled and will not run even when its target class has been discovered.

Target Attribute Values

Value Description

The ID of the targeted ClassType element.

A discovery is targeted at a class type and executes for every instance of that class type. If the class type is not found, the discovery will not run.

Child Elements

Element Description

Category (Discovery)

Required element. Represents the category name of the discovery. Always “Discovery”.

DiscoveryTypes

Required element. Contains the class and/or relationship type IDs that the discovery will discover.

DataSource (Discovery)

Required element. Represents an implementation of a data source module type definition that returns discovery data.

Parent Elements

Element Description

Discoveries

Contains discovery workflow definitions.

Remarks

Discovery workflows must always return a System.Discovery.Data data type. Always create a discovery workflow definition to provide discovery data for your defined ClassTypes and RelationshipTypes elements. No other workflow type should return the System.Discovery.Data data type.

Once the discovery data has been committed to the database, any workflows targeted to the newly discovered class or relationship types, such as in a Rule, UnitMonitor, AggregateMonitor, or DependencyMonitor element will begin to run, as long as the those workflows are enabled.

Because discovery workflows are targeted to a specific class type, they usually use the $Target variable notation to pass instance-specific values to its internal DataSource module. To see how to retrieve instance-specific data from the target class type, reference the sample that follows.

The ConfirmDelivery attribute should be set to true only when you find that the workflow is failing to pass data from the data source to the next module in the workflow. This would happen when the amount of data surpasses a predefined system threshold. When it surpasses this threshold, data items will be dropped for performance reasons. However, when ConfirmDelivery is set to true, the data will not be dropped but the next module in the workflow will acknowledge delivery of the data item to the data source module before it receives its next piece of data.

Example

The following XML sample illustrates a discovery that is used to discover instances of the Microsoft.Windows.Client.XP.LogicalDisk class type. Whenever an instance of the Microsoft.Windows.Client.XP.OperatingSystem target class type is found, this discovery will run to see whether any logical disks exist. Notice how the properties on the DiscoveryClass element are properties that belong to the base class types of the Microsoft.Windows.Client.XP.LogicalDisk class type. These base class types are represented here for clarity.


<ClassType ID="Microsoft.Windows.LogicalDevice" Base="System!System.LogicalHardware" Accessibility="Public" Hosted="true" Abstract="true">
  <Property ID="DeviceID" Type="string" Key="true" />
  <Property ID="Name" Type="string" />
  <Property ID="Description" Type="string" />
</ClassType>

<ClassType ID="Microsoft.Windows.LogicalDisk" Base="Microsoft.Windows.LogicalDevice" Accessibility="Public" Hosted="true" Abstract="true" />

<ClassType ID="Microsoft.Windows.Client.LogicalDisk" Abstract="true" Accessibility="Public" Base="Windows!Microsoft.Windows.LogicalDisk" Hosted="true" Singleton="false">
  <Property ID="FileSystem" Type="string" />
  <Property ID="Compressed" Type="string" />
  <Property ID="Size" Type="string" />
  <Property ID="DriveType" Type="string" />
  <Property ID="SupportsDiskQuota" Type="string" />
  <Property ID="QuotasDisabled" Type="string" />
  <Property ID="SupportsFileBasedCompression" Type="string" />
</ClassType>

<ClassType ID="Microsoft.Windows.Client.XP.LogicalDisk" Abstract="false" Accessibility="Public" Base="WindowsClient!Microsoft.Windows.Client.LogicalDisk" Hosted="true" Singleton="false" />
…
<Discovery ID="Microsoft.Windows.Client.XP.LogicalDisk.Discovery" Enabled="true" Target="Microsoft.Windows.Client.XP.OperatingSystem">
  <Category>Discovery</Category>
  <DiscoveryTypes>
    <DiscoveryClass TypeID="Microsoft.Windows.Client.XP.LogicalDisk">
      <Property TypeID="Windows!Microsoft.Windows.LogicalDevice" PropertyID="DeviceID" />
      <Property TypeID="Windows!Microsoft.Windows.LogicalDevice" PropertyID="Name" />
      <Property TypeID="Windows!Microsoft.Windows.LogicalDevice" PropertyID="Description" />
      <Property TypeID="WindowsClient!Microsoft.Windows.Client.LogicalDisk" PropertyID="FileSystem" />
      <Property TypeID="WindowsClient!Microsoft.Windows.Client.LogicalDisk" PropertyID="Compressed" />
      <Property TypeID="WindowsClient!Microsoft.Windows.Client.LogicalDisk" PropertyID="Size" />
      <Property TypeID="WindowsClient!Microsoft.Windows.Client.LogicalDisk" PropertyID="DriveType" />
      <Property TypeID="WindowsClient!Microsoft.Windows.Client.LogicalDisk" PropertyID="SupportsDiskQuota" />
      <Property TypeID="WindowsClient!Microsoft.Windows.Client.LogicalDisk" PropertyID="QuotasDisabled" />
      <Property TypeID="WindowsClient!Microsoft.Windows.Client.LogicalDisk" PropertyID="SupportsFileBasedCompression" />
    </DiscoveryClass>
    <DiscoveryRelationship TypeID="Windows!Microsoft.Windows.ComputerHostsLogicalDevice" />
  </DiscoveryTypes>
  <DataSource ID="DiscoveryDataSource" RunAs="System!System.PrivilegedMonitoringAccount" TypeID="Windows!Microsoft.Windows.WmiProviderWithClassSnapshotDataMapper">
    <NameSpace>\\$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$\root\cimv2</NameSpace>
    <Query>SELECT * FROM Win32_LogicalDisk WHERE (DriveType=3 or DriveType=6) and FileSystem!=null</Query>
    <Frequency>3605</Frequency>
    <ClassId>$MPElement[Name="Microsoft.Windows.Client.XP.LogicalDisk"]$</ClassId>
    <InstanceSettings>
      <Settings>
        <Setting>
          <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
          <Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="Windows!Microsoft.Windows.LogicalDevice"]/DeviceID$</Name>
          <Value>$Data/Property[@Name='DeviceID']$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="Windows!Microsoft.Windows.LogicalDevice"]/Name$</Name>
          <Value>$Data/Property[@Name='Name']$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="Windows!Microsoft.Windows.LogicalDevice"]/Description$</Name>
          <Value>$Data/Property[@Name='Description']$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="WindowsClient!Microsoft.Windows.Client.LogicalDisk"]/FileSystem$</Name>
          <Value>$Data/Property[@Name='FileSystem']$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="WindowsClient!Microsoft.Windows.Client.LogicalDisk"]/Compressed$</Name>
          <Value>$Data/Property[@Name='Compressed']$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="WindowsClient!Microsoft.Windows.Client.LogicalDisk"]/Size$</Name>
          <Value>$Data/Property[@Name='Size']$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="WindowsClient!Microsoft.Windows.Client.LogicalDisk"]/DriveType$</Name>
          <Value>$Data/Property[@Name='DriveType']$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="WindowsClient!Microsoft.Windows.Client.LogicalDisk"]/SupportsDiskQuota$</Name>
          <Value>$Data/Property[@Name='SupportsDiskQuotas']$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="WindowsClient!Microsoft.Windows.Client.LogicalDisk"]/QuotasDisabled$</Name>
          <Value>$Data/Property[@Name='QuotasDisabled']$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="WindowsClient!Microsoft.Windows.Client.LogicalDisk"]/SupportsFileBasedCompression$</Name>
          <Value>$Data/Property[@Name='SupportsFileBasedCompression']$</Value>
        </Setting>
      </Settings>
    </InstanceSettings>
  </DataSource>
</Discovery>

The following XML sample illustrates a discovery that is used to discover instances of the Microsoft.SystemCenter.ComputerGroupContainsComputer relationship type. Whenever an instance of the Microsoft.Windows.Client.ComputerGroup target class type is found, this discovery will run so that it can populate the group with instances of Microsoft.Windows.Client.Computer. The data source module of type Microsoft.SystemCenter.GroupPopulator returns a System.Discovery.Data element containing the discovered relationship. It will return a relationship object for every client computer it finds and will continue to poll the database looking for any newly deleted or added client computers to add to the group.


<RelationshipType ID="Microsoft.SystemCenter.ComputerGroupContainsComputer" Accessibility="Public" Abstract="false" Base="System!System.Containment">
  <Source>Microsoft.SystemCenter.ComputerGroup</Source>
  <Target>System!System.Computer</Target>
</RelationshipType> 
…
<Discovery ID="Microsoft.Windows.Client.AllClientsComputerGroupDiscovery" Enabled="onEssentialMonitoring" Target="Microsoft.Windows.Client.ComputerGroup" Remotable="true">
  <Category>Discovery</Category>
  <DiscoveryTypes>
    <DiscoveryRelationship TypeID="SC!Microsoft.SystemCenter.ComputerGroupContainsComputer" />
  </DiscoveryTypes>
  <DataSource ID="DiscoveryDataSource" TypeID="SC!Microsoft.SystemCenter.GroupPopulator">
    <RuleId>$MPElement$</RuleId>
    <GroupInstanceId>$Target/Id$</GroupInstanceId>
    <MembershipRules>
      <MembershipRule>
        <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Client.Computer"]$</MonitoringClass>
        <RelationshipClass>$MPElement[Name="SC!Microsoft.SystemCenter.ComputerGroupContainsComputer"]$</RelationshipClass>
      </MembershipRule>
    </MembershipRules>
  </DataSource>
</Discovery>

See Also

Reference

ClassType
Discoveries
RelationshipType