Distributed Availability Group Health: T-SQL and Zabbix


After creating a distributed availability group using the steps described in my article, SQL Server 2022 Clusterless Distributed Availability Group, how can we verify if the synchronization between data centers is healthy?

In SQL Server Management Studio, when you right-click a distributed availability group, you will notice that there is no dashboard to confirm whether SQL Server is properly synchronizing data across data centers:

Even if you check the dashboards of the primary and secondary data centers separately, you will not see if there is a problem in-between.

To solve this, we can run a query on the primary