Management pack rules collect data from various sources, such as Perfmon, EventLog, SNMP, and log files. That data is then stored in the Operations Manager database or the data warehouse and can be used for reporting purposes. This topic shows how to create two rules: one that gathers information from Windows events, and the other that gathers information from a log file.

Note
This topic assumes that you are using the management pack created in the How to Create a Management Pack With a Discovery Using the Windows Registry Template topic.

Creating a Windows Event Rule

  1. Select the Health Model space in the authoring console, and then click the Rules view in the navigation tree.

  2. Right-click in the list view, and then click New, Collection, Event Based, and then Windows Event Collection from the context menu.

  3. Enter AuthoringConsole.MyFirstMP.LOBApplication.CollectEvent101 as the ID of the rule.

  4. Enter Collect event 101 as the display name.

  5. Select AuthoringConsole.MyFirstMP.LOBApplication from the drop-down menu for the target.



  6. Click Next.

  7. Leave Application as the name of the Windows Event Log, and then click Next.



  8. On the expression page, set the Event ID to equal 101 and the Event Source to EventCreate.



  9. Click Finish to create the rule and return to the Rules list. The new rule should appear in the list.

  10. Save the management pack by clicking File, and then clicking Save from the authoring console menu.

Creating a Windows Log File Rule

  1. Select the Health Model space in the authoring console, and then click the Rules view in the navigation tree.

  2. Right-click in the list view, and then click New, Collection, Event Based, Text Log (Delimited) from the context menu.

  3. Enter AuthoringConsole.MyFirstMP.LOBApplication.CollectLogFile as the Element ID of the rule.

  4. Enter Collect Log File as the Display Name.

  5. Select AuthoringConsole.MyFirstMP.LOBApplication from the drop-down for the target menu.



  6. Click Next.

  7. On the Application Log Data Source page, set the Directory to c:\SampleMP

  8. Set the Pattern to *.log

  9. Enter a comma in the Separator field.



  10. Click Next.

  11. On the Build Event Expression page, click Insert, and then specify the following values:

    • Set the Parameter Name to LogFileType

    • Set the Operator to Equals

    • Set the Value to Generic CSV Log File Format



  12. Click Finish to create the rule.

  13. Save the management pack by clicking File, and then clicking Save from the authoring console menu.

See Also