Ad Widget

Collapse

How to avoid alerts when SQL Server AG is failed over (With a solution)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ZABBIX_LEARNER24
    Junior Member
    • Jul 2024
    • 1

    #1

    How to avoid alerts when SQL Server AG is failed over (With a solution)

    Hello all,
    I work with MSSQL AG with 2 nodes. One has been primary since I started working and the other node is secondary. We happened to be in a situation where we failed over the AG and now the secondary has become the primary node. It will stay primary until the next maintenance cycle.

    This change brought a new surprise for us. A discovered trigger from the template (MSSQL by ODBC) "MSSQL: AG '{#GROUP_NAME}': All replicas unhealthy" has started sending alerts from the node which was primary previously. I had to add a condition in the trigger expression to confirm if the node is primary ( last(/MSSQL by ODBC/mssql.synchronization_health["{#GROUP_NAME}"])=0 ) and that stopped the trigger from sending alerts from the secondary node (which was primary previously).

    Should this check be a part of the low level trigger (MSSQL AG '{#GROUP_NAME}': All replicas unhealthy) and likewise triggers which rely on the node being primary?

    I am unsure how much overhead it adds for adding that condition but I like to believe it is super useful for those environments in which failovers between nodes are planned.

    I would like to recommend this to be added to the template if it is designed by Zabbix core group.

    Thank you,

    A-DBA
Working...