本文件已封存並已停止維護。

How to Create a Registry Discovery

更新日期: 2010年1月

適用於: System Center Operations Manager 2007

The following procedure shows how to create a registry 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 registry discovery created in this procedure has the following characteristics:

  • Searches for the application on all computers.

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

  • An instance of the class should only be created if a registry key named HKLM:\SOFTWARE\MyApp exists.

  • If a class is created, the version should be collected from the value HKLM:\SOFTWARE\MyApp\Version.

To create a registry discovery

  1. Select Health Model, and then select Discoveries.

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

  3. On the General page, do the following:

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

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

    3. In the Target box, select Browse all classes

    4. In the Management Pack Class Chooser box, select Microsoft.Windows.OperatingSystem, and then click OK.

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

    6. Click Next.

  4. On the Schedule page in the Run every box, select 1 Hours, and then click Next. Do not select the box Synchronize at: box

  5. On the Computer page, notice that the Computer box should already contain the following required text: $Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$. If it does not, instead of typing the text, fill it in by selecting the button to the right side of the Computer box, selecting (Host=Windows Computer), and then selecting Network Name (Windows Computer). Click Next. This option specifies the name of the computer on which the registry will be searched. The $Target variable specified refers to the network name of the computer that is hosting the target operating system object.

  6. On the Registry Probe Configuration page, do the following:

    1. Click Add.

    2. In the Edit Attribute Properties dialog box, select Key for the Object Type.

    3. In the Name box, type AppExists.

    4. In the Path box, type SOFTWARE\MyApp.

    5. In the Attribute Type box, select Check if exists. Click OK.

    6. Click Add.

    7. In the Edit Attribute Properties dialog box, select Value for the Object Type.

    8. In the Name box, type AppVersion. In the Path box, type SOFTWARE\MyApp\Version.

    9. In the Attribute Type box, select String. Click OK.

    10. Click Next.

  7. On the Build Event Expression page, do the following:

    1. Click Insert.

    2. Click the button to the right side of the Parameter Name box, and then select AppExists.

    3. In the Operator box, select Equals.

    4. In the Value box, type True.

    5. Click Next.

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

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

    2. In the Key Properties section, click the button to the right 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/Values/AppVersion$. This step uses a $Data variable to resolve to the data that is stored in the Version registry value that is defined on the Registry Probe Configuration page. 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.

  9. Select File, and then click Save.

顯示: