SQL Server Long Running Query

DESCRIPTION

This alert is for SQL Server instances only and will tell you when SQL statements are currently running and have been for more than a defined amount of time. The query limits the result set to any session that has been running for more than 30 seconds. If you want to catch queries that have been running for more than 5 minutes, set you Critical threshold to 300 seconds for Min and leave Max empty. Also set the execution interval for the alert to 5 minutes or less.

ALERT DEFINITION

To create the alert, click on Alerts > Manage Alerts tab and create a Custom Alert of type Custom SQL Alert - Multiple Numeric Return. Configure the alert as needed and paste in the attached query.