Last month I developed a procedure to run in a SQL Server Agent Job, to monitor the synchronism status of the AlwaysOn Availability Groups.
In case of “NO HEALTHY” status, the SP will send an email providing details of every databases.
– DatabaseMail Instaled
EXEC [pr_monitor_alwayson] ‘PRIMARY’ –On Primary replica
EXEC [pr_monitor_alwayson] ‘SECONDARY’ –On Secondary replica
In the next post, I’m going to provide scripts of alerts that I usually configure to complement details about each event that occur in AlwaysOn Availability Groups.
I hope this helps you. If you have any doubt, please let me know.