Trying to create a single pane of glass for all our servers as to the Availability Group State and Health. I want to do this by writing an app and calling t-sql statements to gather data from each of the server master tables/views and then displaying as a combined dashboard.
I am using the sys views but am running into the following issue:
Running select * from sys.dm_hadr_database_replica_states
from the Primary replica displays the states for both Primary and Secondary replicas for each database, but running it from the Secondary replica only displays results for the Secondary.
For example, when run from the Primary, I get:
TAPSLog ONLINE FULL SRVR-01-HA TAPSLog_LN Secondary SYNCHRONIZED HEALTHY NULL NULL
TAPSLog ONLINE FULL SRVR-01 TAPSLog_LN Primary SYNCHRONIZED HEALTHY ONLINE NULL
And from the Secondary:
TAPSLog ONLINE FULL SRVR-01-HA TAPSLog_LN Secondary SYNCHRONIZED HEALTHY NULL NULL
Does anyone know if its possible to read the status of all replicas from all replicas and I am just using the wrong tables?