Health State

Microsoft.JEE.Tomcat.5.Deep.Application.AvailabilityHealth.UnitMonitor (UnitMonitor)

Monitors the health state of the deployed applications for a Tomcat 5.x web application server.

Knowledge Base article:

Summary

The application availability health monitor tracks the state of a deployed application, and uses the following query to find all available applications:

Each MBean's state is examined: 0 implies the application is stopped, 1 implies the application is started. This does not conform with JSR-77.

Causes

A warning indicates that the monitored application is either in a stopping or starting state.

A critical indicator means that the monitored application is either in a stopped or failed state.

Resolutions

Applications in a warning state are either starting or stopping. Click the Recalculate Health button to recalculate the health status.

Applications in a critical state can be either stopped or failed. Check the Alert Context tab of the Alert Properties for more information. Stopped applications need only to be restarted, whereas applications that have failed will need to be examined.

Element properties:

TargetMicrosoft.JEE.Tomcat.5.Application
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.JEE.Deep.Application.TwoState.Query.AvailabilityHealth.MonitorType
RemotableTrue
AccessibilityPublic
Alert Message
Application is not running
The application '{3}' is not running. This application can be identified by the ObjectName '{2}' on the machine {1} for the application server ID '{0}'.
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.JEE.Tomcat.5.Deep.Application.AvailabilityHealth.UnitMonitor" Accessibility="Public" Enabled="true" Target="Microsoft.JEE.Tomcat.5.Application" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="JEE!Microsoft.JEE.Deep.Application.TwoState.Query.AvailabilityHealth.MonitorType" ConfirmDelivery="true">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.JEE.Tomcat.5.Deep.Application.AvailabilityHealth.UnitMonitor_AlertMessageResourceID">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<!-- The alert description should include key properties of: -->
<!-- * the application server id -->
<!-- * the application hostname -->
<!-- * the application object name-->
<!-- * the application name -->
<AlertParameter1>$Target/Host/Property[Type="JEE!Microsoft.JEE.ApplicationServer.Monitored.Instance"]/Id$</AlertParameter1>
<AlertParameter2>$Target/Host/Property[Type="JEE!Microsoft.JEE.ApplicationServer.Monitored.Instance"]/HostName$</AlertParameter2>
<AlertParameter3>$Target/Property[Type="JEE!Microsoft.JEE.Application"]/ObjectName$</AlertParameter3>
<AlertParameter4>$Target/Property[Type="JEE!Microsoft.JEE.Application"]/ApplicationName$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Healthy" MonitorTypeStateID="Healthy" HealthState="Success"/>
<OperationalState ID="NotHealthy" MonitorTypeStateID="NotHealthy" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ComputerName>$Target/Host/Property[Type="JEE!Microsoft.JEE.ApplicationServer.Monitored.Instance"]/HostName$</ComputerName>
<Protocol>$Target/Host/Property[Type="JEE!Microsoft.JEE.ApplicationServer.Monitored.Instance"]/Protocol$</Protocol>
<Port>$Target/Host/Property[Type="JEE!Microsoft.JEE.ApplicationServer.Monitored.Instance"]/Port$</Port>
<BaseURL/>
<JMXQuery>Catalina:j2eeType=WebModule,*</JMXQuery>
<AdditionalArguments>&amp;MaxDepth=1</AdditionalArguments>
<RequestBody/>
<!-- This will query all of the available MBeans and -->
<!-- look for the right MBean and update the state as stated -->
<!-- in the SPEC for Tomcat: -->
<!-- * Healthy : state == 1 -->
<!-- * Critical : state == 0 -->
<HealthyExpression>
<SimpleExpression>
<ValueExpression>
<!-- The XPATH if it were applied directly against the XML in a browser should look like: -->
<!-- /MBeans/org.apache.commons.modeler.BaseModelMBean[@objectName="Catalina:j2eeType=WebModule,name=//localhost/,J2EEApplication=none,J2EEServer=none"]/Properties/state -->
<XPathQuery Type="String">MBeans/MBean[@Name='org.apache.commons.modeler.BaseModelMBean' and @objectName="$Target/Property[Type="JEE!Microsoft.JEE.Application"]/ObjectName$"]/Properties/Property[@Name='state']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">1</Value>
</ValueExpression>
</SimpleExpression>
</HealthyExpression>
<NotHealthyExpression>
<SimpleExpression>
<ValueExpression>
<!-- The XPATH should look like: -->
<!-- /MBeans/org.apache.commons.modeler.BaseModelMBean[@objectName="Catalina:j2eeType=WebModule,name=//localhost/,J2EEApplication=none,J2EEServer=none"]/Properties/state -->
<XPathQuery Type="String">MBeans/MBean[@Name='org.apache.commons.modeler.BaseModelMBean' and @objectName="$Target/Property[Type="JEE!Microsoft.JEE.Application"]/ObjectName$"]/Properties/Property[@Name='state']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">0</Value>
</ValueExpression>
</SimpleExpression>
</NotHealthyExpression>
<IntervalSeconds>900</IntervalSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>