Availability Replicas Role
This monitor rolls up the state of role of all availability replicas and checks whether any availability replica is not in a healthy role. The monitor is unhealthy state when any availability replica is neither primary nor secondary. The monitor is healthy state otherwise.
In this availability group, at least one availability replica does not currently have the primary or secondary role.
Find the availability replica whose role is not primary or secondary using availability replica monitor state and resolve the issue at the availability replica.
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/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth"]/AvailabilityGroupName$-AlwaysOnAgReplicasRoleHealthPolicy |
Timeout (seconds) | Specifies the time the workflow is allowed to run before being closed and marked as failed. | 300 |
Target | Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth |
Parent Monitor | System.Health.AvailabilityState |
Category | AvailabilityHealth |
Enabled | True |
Alert Generate | False |
Alert Auto Resolve | False |
Monitor Type | Microsoft.SQLServer.2012.AlwaysOn.SystemPolicyScriptMonitorType |
Remotable | True |
Accessibility | Public |
RunAs | Microsoft.SQLServer.2012.AlwaysOn.MonitoringAccount |
<UnitMonitor ID="Microsoft.SQLServer.2012.AlwaysOn.AvailabilityReplicaRoleState" RunAs="Microsoft.SQLServer.2012.AlwaysOn.MonitoringAccount" TypeID="Microsoft.SQLServer.2012.AlwaysOn.SystemPolicyScriptMonitorType" Accessibility="Public" Enabled="true" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Target="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth" Priority="Normal">
<Category>AvailabilityHealth</Category>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="HealthState" HealthState="Success"/>
<OperationalState ID="Critical" MonitorTypeStateID="ErrorState" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<Interval>900</Interval>
<TimeoutSeconds>300</TimeoutSeconds>
<PolicyName>$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth"]/AvailabilityGroupName$-AlwaysOnAgReplicasRoleHealthPolicy</PolicyName>
<InstanceName>$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2012.AlwaysOn.AvailabilityGroupHealth"]/InstanceName$</InstanceName>
</Configuration>
</UnitMonitor>