Has anyone created a monitor for SQL Backup jobs, that have taken longer than x number of hours to complete?
Hi, I have created an alert rule that uses the data from AppInsight for SQL, this one gathers agent job status. The alert rule is a "Custom SQL alert" (Should probably rather be a custom SWQL alert but I haven't converted it yet)
Below is the code you use in. The last to lines is to filter on the SQL Agent job names.
WHERE ( (APM_SqlBbJobAlertsData.LastRunDuration >= 21600) AND (APM_SqlBbJobAlertsData.LastRunDuration <= 28000) AND(APM_SqlBbJobAlertsData.LastRunDate > dateadd(d,-2,Getdate())) AND ( NOT (APM_SqlBbJobAlertsData.Name LIKE 'MT - %') AND NOT (APM_SqlBbJobAlertsData.Name LIKE '%Offload_%') ))