|   Register
Wednesday, March 10, 2010    
Monitors - Schema Layout

Monitors.PNG

Illustration from Altova XML Spy

Aggregate Monitor Element
An aggregate monitor is used to roll up health from child monitors according to some algorithm. This roll up is within the same object (use dependency monitors to roll up across a relationship). Currently the algorithms in OpsMgr 2007 for aggregate monitors are:
  • Worst Of
  • Best Of
The monitor can optionally generate an alert if the Alert Settings element is specified. The schema for an aggregate monitor is:
 

Illustration from Altova XML Spy 

All objects in Ops Mgr inherit five base aggregate monitors from System.Entity. Therefore the health explorer for objects of any type will always show these even if no additional monitors are specified. For example here are the health monitors for an Application I defined called Application X:
 

 
These base aggregate monitors are used to provide buckets to roll up appropriate aggregate, unit and dependency monitors for the target type.
The attributes for the Aggregate Monitor are:

Name  
Type  
Use  
Description  
ID  
ManagementPack
UniqueIdentifier
Required  
The identity of the element. This must be unique within all elements of the management pack
Comment  
ManagementPackString
Optional  
Use for author comments.
Accessibility
ManagementPack
Accessibility
Required
Defines visibility of element from other MPs. Set to internal or public
Enabled  
ManagementPack
MonitoringLevel
Optional
Defines if the monitor  is enabled by default. Set to true or false. Other values allowed are OnEssentials, OnStandard, OnAdvanced. These will only be enabled in conjunction with category overrides.
Target
ManagementPack
IdentifierReference
Required
The target class. The monitor will run against all instances of the targeted class.
Parent
MonitorID
ManagementPack
IdentifierReference
Required
The aggregate monitor to roll health up to.
Remoteable
xsi:boolean
Optional  
Defines whether this workflow will run for agentless monitoring. If it is not specified it is assumed to be true
Priority
ManagementPack
WorkflowPriority
Optional  
TBC
RunAs
ManagementPack
IdentifierReference
Optional
References a secure reference. You should use this attribute only if you want to associate this monitor with a Run As profile.

 In the Management Pack schema, the ParentMonitorID attribute is not required. However MPVerify will fail if it is not provided. There is only one monitor that is allowed to have this empty and that is the System.Health.EntityState monitor defined in the System.Health.Library MP.

Category

The category of a monitor must be one of the standard category strings. However for a monitor it is recommended that you use the same category as the overall aggregate monitor that it runs for. This will be one of the following:
  •  AvailabilityHealth
  • PerformanceHealth
  • ConfiguraitonHealth
  • SecurityHealth
The category field is not really used for anything in Operations Manager 2007. Category overrides can take advantage of this field but this concept is not exposed in the Ops Mgr UI.

Alert Settings

This is covered in a common section on this monitors page since it is the same for aggregate, dependency and unit monitors.

Algorithm

The algorithm element has no attributes and contains the name of the algorithm. There are only two options in OpsMgr 2007:
Worst Of:
<Algorithm>WorstOf</Algorithm>
             This rolls up the worst state of any member:

 

Best Of:
<Algorithm>BestOf</Algorithm>
             This rolls up the best state of any member:

 
Unit Monitor
A unit monitor is used to monitor a particular aspect of an object such as an application, device or service. A unit monitor uses some instrumentation or some probing action to determine the current state of the aspect e.g. Windows Events, Perf data, log files, WMI, SNMP, Scripts.
A unit monitor is defined to be of a particular unit monitor type. You should refer to the type definitions section of this schema guide for more information on creating monitor types. Out of the box Operations Manager 2007 ships with over 200 monitor types. These are predefined workflows that monitor for specific types of instrumentation. Some of the Windows Event based monitor types as defined in the Microsoft.Windows.Library MPare:
You should refer to the type library section of this site for details of all the monitor types and what they do (coming soon!). If you cannot find the monitor type to suit your needs you can create a new monitor type.
A unit monitor will always roll health up to a parent aggregate monitor and the health will ultimately be rolled up to the health of an object in Operations Manager.
The schema for a unit monitor is:
 
 

Illustration from Altova XML Spy 

The attributes for a Unit Monitor are:

Name  
Type  
Use  
Description  
ID  
ManagementPack
UniqueIdentifier
Required  
The identity of the element. This must be unique within all elements of the management pack
Comment  
ManagementPackString
Optional  
Use for author comments.
Accessibility
ManagementPack
Accessibility
Required
Defines visibility of element from other MPs. Set to internal or public
Enabled  
ManagementPack
MonitoringLevel
Optional  
Defines if the monitor is enabled by default. Set to true or false. Other values allowed are OnEssentials, OnStandard, OnAdvanced. These will only be enabled in conjunction with category overrides. The default is true if this attribute is not set
Target
ManagementPack
IdentifierReference
Optional  
The target class. The monitor will run against all instances of the targeted class.
Parent
MonitorID
ManagementPack
IdentifierReference
Required
The aggregate monitor to roll health up to.
Remoteable
xsi:boolean
Optional  
Defines whether this workflow will run for agentless monitoring. If it is not specified it is assumed to be true
Priority
ManagementPack
WorkflowPriority
Optional  
TBC
RunAs
ManagementPack
IdentifierReference
Optional
References a secure reference. You should use this attribute only if you want to associate this monitor with a Run As profile.
TypeID
ManagementPack
IdentifierReference
Required
References a monitor type definition. The monitor must have configuration that validates to the schema for this monitor type
Confirm
Delivery
xsi:Boolean
Optional
TBC

 
In the Management Pack schema, the ParentMonitorID attribute is not required. However MPVerify will fail if it is not provided. There is only one monitor that is allowed to have this empty and that is the System.Health.EntityState monitor defined in the System.Health.Library MP.

Category

The category of a monitor must be one of the standard category strings. However for a monitor it is recommended that you use the same category as the overall aggregate monitor that it runs for. This will be one of the following:
  • AvailabilityHealth
  • PerformanceHealth
  • ConfiguraitonHealth
  • SecurityHealth
The category field is not really used for anything in Operations Manager 2007. Category overrides can take advantage of this field but this concept is not exposed in the Ops Mgr UI.

Alert Settings

This is covered in a common section on this monitors page since it is the same for aggregate, dependency and unit monitors.

Operational States

This section defines operational states that map to the state of the monitor type. This allows the MP Author to customize the name and description of the state declared for the monitor type (the monitor type state ID). For example the monitor type to monitor if a Windows service is running on stopped may have two states called Running and Not Running. A monitor that is defined of this type must define two operational states that map to the monitor type states. In the case of SQL Server service monitoring these might be called SQL Service Running and SQL Service Stopped.
The monitor type definition does not declare how monitor type states map to health state (healthy, warning, error). It is up to the monitor to declare this mapping as it is dependent on the monitoring logic.
The monitor must have an operational state defined for each monitor type state. If this is not done, MPVerify will raise an error.
The operational state element has the following attributes:

Name  
Type  
Use  
Description  
ID  
ManagementPack
UniqueIdentifier
Required  
The identity of the element. This must be unique within all elements of the management pack
Comment  
ManagementPackString
Optional  
Use for author comments.
MonitorType
StateID
ManagementPack
LocalIdentifierReference
Required
The monitor type state ID that this operational state is mapped to. This must be a valid state ID declared on the reference monitor type
HealthState  
HealthState
Required
The health state for this operational state – this should be set to Warning, Error or Success

 Here is an example declaration of operational states:
<OperationalStates>
      <OperationalStateID="ComponentProblem"HealthState="Warning"MonitorTypeStateID="FirstEventRaised"/>
      <OperationalStateID="ComponentOK"HealthState="Success"MonitorTypeStateID="SecondEventRaised"/>
</OperationalStates>
Each operational state can have a display string assigned in the language pack section of the MP. The monitor ID is the MPElement and the Operational State ID is the sub element. Therefore to define the display string for the ComponentProblem state above the following display string would be used if the monitor ID was Demo.EventBasedMonitor1:
<DisplayStringElementID="Demo.EventBasedMonitor1"SubElementID="ComponentProblem">
      <Name>Component Error</Name>
      <Description>The component is in an unhealthy state</Description>
</DisplayString>

Configuration

The configuration element must contain the necessary configuration for the monitor type that is being used. MPVerify will check this configuration. It is not possible for XML tools to verify the inner XML of the configuration element because this is a schema within a schema. The MP Schema allows any XML. Most monitor types will have different configuration schema requirements. For example the Microsoft.Windows.CheckNTServiceStateMonitorType in the Microsoft.Windows.Library MP requires two configuration elements – computer name and service name. The configuration section of a monitor would look something like:
<Configuration>
      <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
      <ServiceName>spooler</ServiceName>
</Configuration>
A different monitor type such as the System.Performance.AverageThreshold type in the System.Performance library requires a different configuration e.g.
<Configuration>
      <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
      <CounterName>% Interrupt Time</CounterName>
      <ObjectName>Processor</ObjectName>
      <InstanceName>_Total</InstanceName>
      <Frequency>120</Frequency>
      <Threshold>10</Threshold>
      <NumSamples>5</NumSamples>
</Configuration>
 
Dependency Monitor Element
A dependency monitor is used to roll up health of other objects across a containment or hosting relationship according to some algorithm. It is not possible to roll up health across a reference relationship. Currently the algorithms in OpsMgr 2007 for aggregate monitors are:
  • Worst Of
  • Best Of
  • Percentage Of
The monitor can optionally generate an alert if the Alert Settings element is specified. The schema for a dependency monitor is:
 

Illustration from Altova XML Spy 

The attributes for the Dependency Monitor are:
Name  
Type  
Use  
Description  
ID  
ManagementPack
UniqueIdentifier
Required  
The identity of the element. This must be unique within all elements of the management pack
Comment  
ManagementPackString
Optional  
Use for author comments.
Accessibility
ManagementPack
Accessibility
Required
Defines visibility of element from other MPs. Set to internal or public
Enabled  
ManagementPack
MonitoringLevel
Required  
Defines if the monitor  is enabled by default. Set to true or false. Other values allowed are OnEssentials, OnStandard, OnAdvanced. These will only be enabled in conjunction with category overrides.
Target
ManagementPack
IdentifierReference
Optional  
The target class. The monitor will run against all instances of the targeted class.
Parent
MonitorID
ManagementPack
IdentifierReference
Required
The aggregate monitor to roll health up to.
Remoteable
xsi:boolean
Optional  
Defines whether this workflow will run for agentless monitoring. If it is not specified it is assumed to be true
Priority
ManagementPack
WorkflowPriority
Optional  
TBC
RunAs
ManagementPack
IdentifierReference
Optional
References a secure reference. You should use this attribute only if you want to associate this monitor with a Run As profile.
Relationship
Type
ManagementPack
IdentifierReference
Required
The relationship type that health will be rolled up across.
Member
Monitor
ManagementPack
IdentifierReference
Required
The monitor on the other side of the relationship that will be rolled up.
 
In the Management Pack schema, the ParentMonitorID attribute is not required. However MPVerify will fail if it is not provided. There is only one monitor that is allowed to have this empty and that is the System.Health.EntityState monitor defined in the System.Health.Library MP.
The MemberMonitor attribute must refer to the ID of a monitor defined against the target class of the relationship type that is specified or a monitor that the type inherits. For example consider the following class and relationship definition that defines an application, an application component and a hosting relationship between them:
<EntityTypes>
      <ClassTypes>
            <ClassTypeID="Demo.ApplicationX"Abstract="false"Accessibility="Internal"Hosted="true"Base="Windows!Microsoft.Windows.LocalApplication">
                  <PropertyID="Version"Type="string"/>
                  <PropertyID="Path"Type="string"/>
            </ClassType>
            <ClassTypeID="Demo.ApplicationXComponent"Abstract="false"Accessibility="Internal"Hosted="true"Base="Windows!Microsoft.Windows.ApplicationComponent"/>
      </ClassTypes>
      <RelationshipTypes>
            <RelationshipTypeID=" Demo.ApplicationXHostsApplicationXOptionalComponent"Abstract="false"Accessibility="Internal"Base="System!System.Hosting">
                  <Source> ApplicationX</Source>
                  <Target> ApplicationXComponent</Target>
            </RelationshipType>
      </RelationshipTypes>
</EntityTypes>
 
Now to add a dependency monitor to roll up all avilability health from application component objects to the application, I would add a dependency monitor targeted at the Demo.ApplicationX class. This would have settings:
Target: Demo.ApplicationX
ParentMonitorID: SystemHealth!System.Health.AvailabilityState
MemberMonitor: SystemHealth!System.Health.AvailabilityState
RelationshipType: Demo.ApplicationXHostsApplicationXOptionalComponent

Category

The category of a monitor must be one of the standard category strings. However for a monitor it is recommended that you use the same category as the overall aggregate monitor that it runs for. This will be one of the following:
  • AvailabilityHealth
  • PerformanceHealth
  • ConfiguraitonHealth
  • SecurityHealth
The category field is not really used for anything in Operations Manager 2007. Category overrides can take advantage of this field but this concept is not exposed in the Ops Mgr UI.

Alert Settings

This is covered in a common section on this monitors page since it is the same for aggregate, dependency and unit monitors.

Algorithm and Algorithm Parameter

The algorithm element has no attributes and contains the name of the algorithm. There three options for a dependency monitor in OpsMgr 2007:
Worst Of:
<Algorithm>WorstOf</Algorithm>
This rolls up the worst state of any member:

Best Of:
<Algorithm>BestOf</Algorithm>
                This rolls up the best state of any member:

Percentage Of
<Algorithm>Percentage</Algorithm>
This rolls up the best specified percentage of members:

When Percentage is specified as the algorithm you must specify an addition element, AlgorithmParameter that contains the percentage value e.g.
<AlgorithmParameter>60</AlgorithmParameter>

MemberInMaintenance

This optional parameter specifies the health state attributed to a member in maintenance mode. It can be any valid health state:
  • Uninitialized
  • Success
  • Warning
  • Error
If the element is not specified it defaults to uninitialized.

MemberUnavailable

This optional parameter specifies the health state attributed to a member that is unavailable. It can be any valid health state:
  • Uninitialized
  • Success
  • Warning
  • Error
If the element is not specified it defaults to uninitialized.
Alert Settings
Any type of monitor can optionally generate an alert based on a state change to a non healthy state. The alert settings is an optional element in each type of monitor:
  

Illustration from Altova XML Spy 

The alert settings element takes one optional attribute:

Name  
Type  
Use  
Description  
Alert
Message 
ManagementPack
IdentifierReference
Optional
A reference to a string resource that is used to define a localized name and description

 If an Alert Message is not specified an alert will be generated with the name and description of the monitor. This is normally not useful to the OpsMgr operator. So you should always specify an alert message. An example for the alert message would be.
<AlertSettingsAlertMessage="Demo.SpoolerServiceHealth.AlertMessage">
This must point to a valid string resource defined in the presentation section of the management pack:
<StringResourceID="Demo.SpoolerServiceHealth.AlertMessage"/>
The string resource then has a display name and description set. This is covered in more detail below.

Alert On State

An alert will be generated for a specific state of the monitor. This can either be for a state of warning or for error. If it is set for warning, the alert will also be generated for an error state. You are specifying the lowest state to alert for. This element has no attributes. It takes a single string that corresponds to the lowest health state to alert on. It would either be:
<AlertOnState>Warning</AlertOnState>
Or
<AlertOnState>Error</AlertOnState>
Note that you must ensure the health state you specify is actually a possible state of the monitor i.e. if you do not have an error state then you cannot specify Error. MPVerify will catch this issue.

Auto Resolve

Auto resolve is an element that has no attributes. It takes a single string that is either true or false. This setting determines if the alert will be auto resolved when the monitor state goes back to healthy e.g.
<AutoResolve>true</AutoResolve>
Or
<AutoResolve>false</AutoResolve>

Alert Priority

TBC

Alert Severity

This is the severity level of the alert. The valid options are:
  • Error
  • Information
  • MatchMonitorHealth
  • Warning
If you do not specify the element it defaults to matching the monitor health state. This is a single XML element with no attributes e.g.
<AlertSeverity>Information</AlertSeverity>

Alert Parameters

Alert parameters are used to populate the description of an alert. These are used in combination with a string resource to build a localized name description for the alert. If you are just using static text for the alert description you do not need to use alert parameters. If you want to include $Target properties and $Data properties in the description then you must use alert pararamters.
You can have up to 10 parameters for the monitor. These can be any $Target properties (including host properties) or any data context properties. See the sections on this site about MP variable substitution and data types to understand more about these properties. Here is an example for a monitor that runs against an application hosted on a Windows computer and uses event data. It uses a $Target and $Data in the alert parameters.
<AlertSettingsAlertMessage="Demo.EventBasedMonitor1.AlertMessage">
      <AlertOnState>Warning</AlertOnState>
      <AutoResolve>true</AutoResolve>
      <AlertPriority>Normal</AlertPriority>
      <AlertParameters>
            <AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
            <AlertParameter2>$Data/Context/EventNumber$</AlertParameter2>
      </AlertParameters>
</AlertSettings>
 
This would then have a string resource as follows in the presentation section:
<StringResources>
      <StringResourceID="Demo.EventBasedMonitor1.AlertMessage"/>
</StringResources>
The alert parameters are used in the display string for the string resource. When the alert is displayed in the Operations Console the description string is substituted in correctly.   You use a curly brace notation to substitute in the correct parameter. Note that {0} refers to alert parameter 1, {2} refers to alert parameter 2 etc.
The display string for the string resource in the above example might be:
<DisplayStringElementID="Demo.EventBasedMonitor1.AlertMessage">
      <Name>Error was encountered</Name>
      <Description>Event {1} on computer {0} triggered this alert</Description>
</DisplayString>
This would lead to an alert as shown below:

 
 
 You can see that the event ID that triggered the state change and the computer name are substituted into the description of the alert.

Copyright 2009 Steve Wilson   |  Privacy Statement  |  Terms Of Use