Version 2

    Description

    This custom alert is an improved and more generic alert than here: SQL Server SQL Agent Alert - Monitor SQL Agent. It also does not use external stored procedures and instead uses a DMV internal to the database instance.

     

    This alert will run against the monitored instance and determine if the SQL Agent is Started or Stopped.  If Stopped, this alert will fire and send the appropriate emails. The alert can be created in DPA by clicking on Alerts > Manage Alerts and creating a custom alert of type Custom SQL Alert - Single Boolean Return.

     

    SQL Statement

     

    IF EXISTS(SELECT 1 FROM sys.dm_exec_sessions WHERE program_name = 'SQLAgent - Generic Refresher')

        SELECT 'TRUE'

    ELSE

        SELECT 'FALSE'

     

    Alert Definition