I’d been looking for a simple alert to run in SQL Agent to notify me of failover and alert number’s 41074 and 35266 seem to work reliably if you just need to know you’ve failed over.
Also using some of the new dynamic management views for monitoring and reporting we can take a look at all the availability groups on our instance and quick see their state.
SELECT
sag.name,
hags.synchronization_health_desc
FROM sys.availability_groups sag
INNER JOIN sys.dm_hadr_availability_group_states hags ON sag.group_id = hags.group_id
I’ll be looking into this in more detail in the next few weeks and will post my findings.
Alerts and Monitoring for Always on