How to Create a WMI Discovery

Applies To: System Center Operations Manager 2007

The following procedure shows how to create a Windows Management Instrumentation (WMI) discovery in the Operations Manager 2007 Authoring console. Before you perform this procedure, you must first complete the prerequisite procedure How to Create a Class in which you create the classes to be discovered.

The discovery created in this procedure has the following characteristics:

  • Searches for the application on all computers that have an instance of MyComputerRole1.

  • Discovers a class named MyComputerRole2. The class has a single non-key property named Version and no key property.

  • An instance of the class should only be created if a file named C:\MyApp\MyApp.exe exists.

  • If a class is created, the version should be collected from the version property on the file.

To create a WMI discovery

  1. Select Health Model, and then select Discoveries.

  2. Right-click in the right-side pane, select New, and then select WMI.

  3. On the General page, do the following:

    1. In the Element ID box, type MyMP.Discovery.MyComputerRole2.

    2. In the Display Name box, type Discover Computer Role 2.

    3. In the Target box, select MyMP.MyComputerRole1.

    4. In the Category box, select Discovery, and then click Next.

  4. On the WMI Configuration page, do the following:

    1. In the WMI Namespace box, type root\cimv2.

    2. In the Query box, type select name, version from cim_datafile where name ='c:\\MyApp\\MyApp.exe'.

    3. In the Frequency (seconds) box, type 14400. Click Next.

  5. On the Discovery Mapper page, do the following:

    1. In the Class ID box, select MyMP.ComputerRole2.

    2. In the Key Properties section, click the button to the right side of the Value for Microsoft.Windows.Computer/PrincipalName, select (Host=Windows Computer), and then select Principal Name (Windows Computer). This step fills in the following text for the value: $Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName. This is a $Target variable that resolves to the computer name of the target agent.

    3. In the Non-Key Properties section, in the Value for MyMP.MyComputerRoleBase\Version, type $Data/Property[@Name='Version']$. This step uses a $Data variable to resolve to the data returned from the WMI query. It cannot be selected from a menu because the menu can only prompt for $Target variables.

    4. Click the button to the right side of the Value for System.Entity/DisplayName, select (Host=Windows Computer), and then select Principal Name (Windows Computer).

    5. Click Finish.

  6. Select File, and then click Save.

See Also

Concepts

Discovery