

WHERE != N'HEALTHY' Ī third approach would be to embed a T-SQL query in the Zabbix agent configuration file that would set a value that would correspond to an Item in Zabbix. 0 is good, any number greater than 0 is bad WHERE mirroring_role_desc IN ('PRINCIPAL','MIRROR')ĪND mirroring_state_desc NOT IN ('SYNCHRONIZED','SYNCHRONIZING') Advantage, uses ability of Zabbix to leverage the the perf counter infrastructure, disadvantage, relies on SQL job to update value and uses one out of only 10 available user defined counters. For example 0 for mirror/AlwaysOn status OK, 1 or greater for a problem. You could query the mirror/AlwaysOn status and set the value to a flag you would use as the health indicator for Zabbix. You would have to use sp_user_counter to set the value.


Advantage, built-in counter, disadvantage, difficult to correlate with mirror status you want.Īnother approach would be to utilize one of the performance counters in the “SQL Server :User Settable” category. You could try the size of the Log Send Queue to see if it grows too high, or maybe the Transaction delay time. One approach would be to use a performance counter in the “SQL Server:Database Mirroring” group as an indicator. I am far from an expert on Zabbix but have a couple of suggestions.
