Diagnostic
Applies To: Operations Manager 2007 R2, System Center Operations Manager 2007
Represents a diagnostic definition targeted at a specific class type and associated monitor.
Schema Hierarchy
ManagementPack
Monitoring
Diagnostics
Diagnostic
Syntax
<Diagnostic ID=”DiagnosticID” Comment=”Comment” Accessibility=”Public/Internal” Enabled=”True/False” Target=”TargetClassID” Monitor=”MonitorID” ExecuteOnState=”Warning/Error” Remotable=”True/False” Timeout=”300”>
<Category>CategoryName</Category>
<ConditionDetection>…</ConditionDetection>
<ProbeAction>…</ProbeAction>
</Diagnostic>
Attributes and Elements
The following sections describe attributes, child elements, and the parent element of a Diagnostic element.
Attributes
Attribute | Description |
---|---|
ID |
Required attribute. Represents the identity of the element. To learn how to identify your element in a management pack, see Element Identity and Namespace Conventions. |
Comment |
Optional attribute. Represents commentary by the management pack author. |
Enabled |
Required attribute. Defines whether or not this workflow is by default enabled or disabled. |
Target |
Required attribute. The ID of the targeted class type of the associated monitor. |
Monitor |
Required attribute. The ID of the monitor that is associated with diagnostic. |
ExecuteOnState |
Required attribute. Defines the health state at which the diagnostic workflow is to be run. |
Remotable |
Optional attribute. Defines whether or not this workflow will run for agentless monitoring. Default value is true. |
Timeout |
Required attribute. The time in seconds that the diagnostic can run. The diagnostic will be terminated if it exceeds this limit. |
Enabled Attribute Values
Value | Description |
---|---|
True |
The workflow is enabled and will run when its target class has been discovered. |
False |
The workflow is disabled and will not run even when its target class has been discovered. |
ExecuteOnState Attribute Values
Value | Description |
---|---|
Error |
Indicates that the diagnostic will run when the associated monitor attains an “Error” state. |
Warning |
Indicates that the diagnostic will run when the associated monitor attains a “Warning” state. |
Child Elements
Element | Description |
---|---|
Represents the category name of a diagnostic. |
|
Represents an implementation of a condition detection module type definition. |
|
Represents an implementation of a probe action module type definition. |
Parent Elements
Element | Description |
---|---|
Contains diagnostic definitions targeted at a specific monitor in the health model. |
Remarks
Diagnostics are workflows that are used to determine the reason why a monitor has changed state. When the monitor reaches the state specified in the ExecuteOnState attribute, the diagnostic will run. Diagnostics never change the state of the system and therefore can contain only one ProbeAction (Diagnostic) module and only one ConditionDetection (Diagnostic) module. The output of the workflow will be sent to the database where it can be viewed from within the health explorer. A Recovery element can also be provided that uses the output of a diagnostic workflow to perform recovery tasks.
Diagnostic workflows always receive the data item that caused the state change of the monitor, and a condition detection module can be included to filter the incoming data item. The data type for the incoming data item is the MonitorTaskDataType data type.
Diagnostics can also be run on-demand. To create a purely on-demand diagnostic, make sure that the diagnostic is disabled.
Example
The following XML sample illustrates a diagnostic that is associated with the Microsoft.SystemCenter.Ping
monitor. It runs the probe action module based on the previous state of the monitor that is associated with it.
<Diagnostic ID="Microsoft.SystemCenter.ManagedComputer.Ping.ICMPDiagnostic" Comment="In response to Ping Monitor, pings machine" Accessibility="Internal" Enabled="true" Target="Windows!Microsoft.Windows.Computer" Monitor="Microsoft.SystemCenter.Ping" ExecuteOnState="Error" Remotable="true" Timeout="300">
<Category>Maintenance</Category>
<ConditionDetection ID="Filter" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>StateChange/DataItem/OldHealthState</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Integer">3</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<ProbeAction ID="Ping" TypeID="SCLibrary!Microsoft.SystemCenter.ICMPProbe">
<ComputerSourcePing>.</ComputerSourcePing>
<NetworkTargetToPing>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</NetworkTargetToPing>
</ProbeAction>
</Diagnostic>
The following XML sample illustrates a diagnostic that uses a probe module to check for SQL broker availability.
<Diagnostic ID="Microsoft.SystemCenter.SqlBrokerAvailabilityDiagnostic" Accessibility="Public" Enabled="false" Target="SCLibrary!Microsoft.SystemCenter.RootManagementServer" Monitor="Microsoft.SystemCenter.SqlBrokerAvailabilityMonitor" ExecuteOnState="Error" Remotable="true" Timeout="300">
<Category>Maintenance</Category>
<ProbeAction ID="OleDbProbe" TypeID="System!System.OleDbTriggerProbe">
<ConnectionString>Provider=SQLOLEDB;Integrated Security=SSPI</ConnectionString>
<Query>SELECT cast(is_broker_enabled as int) FROM sys.databases WHERE name = DB_Name()</Query>
<GetValue>true</GetValue>
<OneRowPerItem>true</OneRowPerItem>
<DatabaseNameRegLocation>SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup\DatabaseName</DatabaseNameRegLocation>
<DatabaseServerNameRegLocation>SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup\DatabaseServerName</DatabaseServerNameRegLocation>
</ProbeAction>
</Diagnostic>