Availability Group Health Policy

Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupErrorPolicyStateMonitor (UnitMonitor)

Two state monitor with 'Error' critical state used particularly for reflecting state of Custom User Policies which have Availability Group as Facet and one of the predefined error categories as Policy Category.

Knowledge Base article:

Summary

This monitor checks the evaluation result of policy in the SQL server instance. The monitor is healthy if the policy was evaluated successfully. Otherwise it is unhealthy.

Resolutions

To diagnose this issue, contact the database administrator or the policy owner with the policy name. The policy owner can determine the root cause of the policy execution evaluation that resulted in Unhealthy state of the monitor.

Overridable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Generates Alerts

Defines whether the workflow generates an Alert.

No

Interval (seconds)

The recurring interval of time in seconds in which to run the workflow.

900

Policy Name

 

$Target/Host/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth"]/AvailabilityGroupName$-$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.Policy"]/PolicyName$

Timeout (seconds)

Specifies the time the workflow is allowed to run before being closed and marked as failed.

300

Element properties:

TargetMicrosoft.SQLServer.2012.AlwaysOn.AvailabilityGroupErrorUserPolicy
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveFalse
Monitor TypeMicrosoft.SQLServer.2012.AlwaysOn.UserPolicyScriptMonitorType
RemotableTrue
AccessibilityPublic
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupErrorPolicyStateMonitor" TypeID="Microsoft.SQLServer.2012.AlwaysOn.UserPolicyScriptMonitorType" Accessibility="Public" Enabled="true" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Target="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupErrorUserPolicy" Priority="Normal">
<Category>AvailabilityHealth</Category>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="HealthState" HealthState="Success"/>
<OperationalState ID="Critical" MonitorTypeStateID="ErrorState" HealthState="Error"/>
</OperationalStates>
<Configuration>
<Interval>900</Interval>
<TimeoutSeconds>300</TimeoutSeconds>
<PolicyName>$Target/Host/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth"]/AvailabilityGroupName$-$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.Policy"]/PolicyName$</PolicyName>
<InstanceName>$Target/Host/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth"]/InstanceName$</InstanceName>
<ComputerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
</Configuration>
</UnitMonitor>