Created
October 24, 2025 11:55
-
-
Save ghotz/3228671204618502e3bf7060243afc53 to your computer and use it in GitHub Desktop.
Availability Groups Alerts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [msdb] | |
| GO | |
| /****** Object: Alert [AG Connection Timeout] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Connection Timeout', | |
| @message_id=35206, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Connection to Primary Inactive] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Connection to Primary Inactive', | |
| @message_id=35250, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Data Movement Suspended] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Data Movement Suspended', | |
| @message_id=35264, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Database in Suspect State] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Database in Suspect State', | |
| @message_id=35275, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Database Inaccessible] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Database Inaccessible', | |
| @message_id=35273, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Database Not Accessible] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Database Not Accessible', | |
| @message_id=976, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Database Out of Sync] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Database Out of Sync', | |
| @message_id=35276, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Database Recovery Pending] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Database Recovery Pending', | |
| @message_id=35274, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Database Restoring] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Database Restoring', | |
| @message_id=3402, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Database Role Resolving] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Database Role Resolving', | |
| @message_id=983, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Failed to Bring AG Online] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Failed to Bring AG Online', | |
| @message_id=41131, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Not Ready for Auto Failover] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Not Ready for Auto Failover', | |
| @message_id=41406, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Replica Cannot Become Primary] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Replica Cannot Become Primary', | |
| @message_id=41142, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Replica Changed States] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Replica Changed States', | |
| @message_id=19406, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Replica Going Offline] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Replica Going Offline', | |
| @message_id=41091, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Role Change (failover)] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Role Change (failover)', | |
| @message_id=1480, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| /****** Object: Alert [AG Secondary Not Connected] Script Date: 1/13/2023 10:36:31 AM ******/ | |
| EXEC msdb.dbo.sp_add_alert @name=N'AG Secondary Not Connected', | |
| @message_id=41414, | |
| @severity=0, | |
| @enabled=1, | |
| @delay_between_responses=60, | |
| @include_event_description_in=1, | |
| @category_name=N'[Uncategorized]', | |
| @job_id=N'00000000-0000-0000-0000-000000000000' | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Connection Timeout', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Connection to Primary Inactive', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Data Movement Suspended', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Database in Suspect State', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Database Inaccessible', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Database Not Accessible', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Database Out of Sync', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Database Recovery Pending', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Database Restoring', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Database Role Resolving', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Failed to Bring AG Online', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Not Ready for Auto Failover', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Replica Cannot Become Primary', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Replica Changed States', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Replica Going Offline', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Role Change (failover)', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO | |
| EXEC msdb.dbo.sp_add_notification @alert_name=N'AG Secondary Not Connected', @operator_name=N'SQLAdmin', @notification_method = 1 | |
| GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment