Add this as a job step on your repository. For the time, YMMV - 30 is actually too short for me, but 60 should work.
This file contains 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
DECLARE @last_insert DATETIME | |
SET @last_insert = (SELECT TOP 1 insert_datetime FROM EventNotificationRec.dbo.ENAudit_Events ORDER BY id DESC) | |
SELECT @last_insert | |
SELECT DATEDIFF(MINUTE,@last_insert, GETDATE()) | |
IF (SELECT DATEDIFF(MINUTE,@last_insert, GETDATE())) >60 | |
begin | |
EXEC msdb.dbo.sp_send_dbmail | |
@profile_name = 'me', | |
@recipients = 'dev@null.com', | |
@subject = '[Priority1] Alert! EN is DOWN!', | |
@body = 'ALERT! The Event Notification table has not received any new messages in over an hour. Investigate immediately.' | |
end |
This file contains 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
DECLARE @last_insert DATETIME | |
SET @last_insert = (SELECT TOP 1 insert_datetime FROM EventNotificationRec.dbo.ENAudit_Events ORDER BY id DESC) | |
SELECT @last_insert | |
SELECT DATEDIFF(MINUTE,@last_insert, GETDATE()) | |
IF (SELECT DATEDIFF(MINUTE,@last_insert, GETDATE())) >60 | |
begin | |
EXEC msdb.dbo.sp_send_dbmail | |
@profile_name = 'me', | |
@recipients = 'dev@null.com', | |
@subject = '[Priority1] Alert! EN is DOWN!', | |
@body = 'ALERT! The Event Notification table has not received any new messages in over an hour. Investigate immediately.' | |
end |