Create a Health Rollup

適用於: Operations Manager 2007 R2

In this topic, the Health rollup is introduced. Sample code is provided so that you can add this functionality to your management pack.

Relate Application Health to Overall System Health

The previous topic describes how to monitor the health of an application. This information is specific to the application. It is useful to relate the Health status of the application to the Health status of the monitored computer.

Create a Monitor Health Rollup

A Health rollup, also known as a dependency monitor, is used to share the Health status of related objects according to an algorithm. The algorithms in Operations Manager 2007 R2 for dependency monitors are as follows:

  • Worst Of – reports the worst health state of any member monitor

  • Best Of – reports the best health state of any member monitor

  • Percentage Of – reports the health state of the collection of member monitors when the percentage of members exceeds the specified threshold

For more information about dependency monitor elements, see Management Packs, Rules, Monitors, and Tasks and Their Relation to Models (https://go.microsoft.com/fwlink/?linkid=152365).

<DependencyMonitor ID="Microsoft.SCX.Authoring.Guide.Computer.SampleAppAvailabilityRollup" Accessibility="Public" Enabled="true" Target="Unix!Microsoft.Unix.Computer" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" Priority="Normal" RelationshipType="Microsoft.Unix.ComputerHostsSampleApplication" MemberMonitor="SystemHealth!System.Health.AvailabilityState">
        <Category>AvailabilityHealth</Category>
        <Algorithm>WorstOf</Algorithm>
      </DependencyMonitor>

The dependency monitor follows the unit monitors in the monitors section of the management pack. Before you add this code to the management pack and import it into Operations Manager, take a moment to observe the Health Explorer in the Operations console

Observe Health Rollup Interaction

To observe the Health rollup before you add the dependency monitor, open the Operations console. Open the Health Explorer view for the monitored server. A tree diagram of availability, configuration, and performance are displayed. Expand the availability node to make sure that the hardware, the operating system, and the UNIX heartbeat monitors are currently installed and monitoring the server. If any of these monitors report an error, the Health state rolls up to the top level and reports that the computer was not healthy.

Add the dependency monitor code to the monitors section in the management pack, increment the version, save the file, and import the management pack into Operations Manager. Refresh the Health Explorer. Expand the availability node. The Microsoft.SCX.Authoring.Guide.Computer.SampleAppAvailabilityRollup should now be included. Continue to expand the tree until the Sample App Health Monitor and the Sample App MD5 Hash Monitor are visible. Modify SampleAppHealth.sh so that a critical state is reported.

Wait a few moments and refresh the Health Explorer. Observe that the Sample App Health Monitor and the Sample App MD5 Hash Monitor are both reporting an unhealthy state and now the monitored computer is also reporting an unhealthy state. Wait a few moments longer until the recovery task executes, performs a corrective action, and returns the computer to a healthy state.