Delen via


MOM Pack

Download sample

This sample demonstrates how a Microsoft Operations Manager (MOM) 2005 Management Pack is used to monitor the basic state and performance of a generic Windows Communication Foundation (WCF) service. By importing this Management Pack into MOM 2005 and running the provided sample, it is possible to view alerts and events in the MOM 2005 Operator Console that are generated from the Management Pack. This sample is based on the Getting Started Sample.

Note

Instructions for building and running the included sample are listed at the end of this topic.

Prerequisites

MOM 2005 with the Administrator and Operator Consoles must be installed along with WMI Provider enabled on all WCF services that are to be monitored.

Microsoft Operations Manager (MOM) 2005 is a management tool used to deliver enterprise-class operations management to improve the efficiency of IT operations. Through the use of Management packs, System Administrators can create plug-ins that enables MOM to monitor systems and applications. For more information about MOM 2005, see Microsoft Operations Manager 2005 Product Overview.

MOM Management Packs

Management Packs are a set of monitoring policies that contain the MOM configuration settings and artifacts for monitoring an application. An artifact is a component of MOM 2005 that is used to monitor and operate an application. Management Packs consist of the following artifacts used to monitor an application: Rules, Provider Instances, Rule Groups, Scripts, and Notification Groups.

WCF Management Pack

Provided with this sample is an example of a MOM 2005 Management Pack that demonstrates rules and responses for monitoring WMI and performance data exposed through a WCF service. Example performance and timed event rules have been provided to demonstrate how to monitor particular data generated from a WCF service, endpoint and operation. Performance rules generate alerts based on the performance counter provided by the Service Model. Timed event rules run a script that polls for specific WMI information that is provided by a WCF service.

Note

For timed event rules to run custom responses such as scripts, you must enable custom responses in the MOM 2005 Administrator Console. This option can be enabled by selecting Global Settings from the Administration tree node and selecting the Security category. Uncheck the box labeled Disable execution of custom responses on Management Servers.

The rules generate a green health status when their defined thresholds have not been surpassed and a red health status when the thresholds have been surpassed.

Step 1: Importing the WCF Management Pack

You can import the provided Management Pack through the Administrator Console. The WCF Management Pack is located in the <install_location>\WCF_WF_CardSpace_Samples\WCF\Basic\Management\MOMPack\<language>\mgmtpack directory in this sample.

To import a MOM management pack.

  1. Open the MOM 2005 Administrator Console from the Start Menu.

  2. Right-click Management Packs from the Console Root tree.

  3. Select Import/Export Management Pack.

  4. Follow the on-screen instructions for adding the provided WCF Management Pack.

  5. Right-click Management Packs from the Console Root tree.

  6. Select Commit Configuration Change.

Note

For the performance rules provided with the WCF Management Pack, a Windows NT performance counter provider based on Service Model performance counter objects was used.

Step 2: Adding Your Server as a Computer Group

Computer groups are collections of servers that are managed by MOM. Servers can either be statically assigned to computer groups or they can be dynamically discovered based on server discovery rules and added or removed to computer groups dynamically. Rule groups are associated with one or more computer groups to determine which servers apply the rules. A computer group must be created and associated to a rule group in order for MOM to monitor an application. The application must also be running on one of the servers contained in the computer group.

Note

There are several rule groups provided with the WCF Management Pack. To make sure that each rule group monitors your applications, you must assign your computer groups to every rule group.

To add a computer group and associate it to a rule group

  1. Open the MOM 2005 Administrator Console from the Start Menu.

  2. Right-click Computer Groups from the Management Packs tree.

  3. Select Create Computer Group…

  4. Follow the instructions provided by the wizard to add your server as a Computer Group.

  5. Right-click the WCF service rule group you created in step 1 and select Associate with Computer Group.

  6. Click the Add button and select the Computer Group you just created.

  7. Click the Apply button.

  8. Right-click Management Packs from the Console Root tree.

  9. Select Commit Configuration Change.

Step 3: Viewing the Health of a WCF Service

The MOM operator or MOM Web consoles can be used to view and act on MOM operational data. On the operator console, it is possible to view events and alerts that are generated from a WCF service by selecting the Alert, Event or State views. After you import the WCF Management Pack and apply the changes, it is possible to view yellow warning alerts and a yellow warning health state of your service. This is expected because the WCF service is currently not active and thus violates some of the provided rules.

To view a red health state

  1. Open the MOM 2005 Operator Console from the Start Menu.

  2. Click the State button see the current state of your server.

  3. Click the Alerts button to see the individual alerts generated by not having the WCF service running on the server.

Next, build the provided calculator service and run its corresponding client code by using the following instructions. This activates the service. Next resolve the current alerts that were generated before the service was running. To resolve the alerts, click the Alerts button, right-click each individual error alert and set their resolution status to Resolve.

Note

Each timed event rule contained in the provided WCF Management Pack is set to run every minute. This can be changed in the MOM 2005 Administrators console.

Note

Each collection of event rules is comprised of a collection of four rules. The Monitor event rule is responsible for generating MOM 2005 events, depending on the state of the WMI object it monitors. The Generate Alert event rules monitor the events generated by the Monitor event rule and generate corresponding alerts. You can change the alert severity that these rules generate by using the MOM 2005 Administrator console.

Click the State button. Notice that the server’s health state has been changed to Green. The server’s health state continues to stay green and green success alerts are generated by both the performance counter and timed event rules.

Note

The AppDomain WMI Data rule, which checks the location of the Web.config file, is hard-coded to look for the file in the location %SystemDrive%\inetpub\wwwroot\servicemodelsamples\web.config. If you are using a different install location, update the script associated with the rule with the new location to prevent reoccurring Web.config alerts.

To set up, build, and run the sample

  1. Ensure you have performed the One-Time Set Up Procedure for the Windows Communication Foundation Samples.

  2. To build the C# or Visual Basic .NET edition of the solution, follow the instructions in Building the Windows Communication Foundation Samples.

  3. To run the sample in a single- or cross-machine configuration, follow the instructions in Running the Windows Communication Foundation Samples.

  4. Click the Alerts button.

  5. Remove the previously existing red critical error alerts by right-clicking each individual alert and setting their resolution status to Resolved.

  6. Finally, green success alerts are generated from the active WCF service running on the server.

© 2007 Microsoft Corporation. All rights reserved.