MOM 2005 SQL Query: Alerts past 1 day Part 1
Woot
I'm finally caught up from being off work for 4 days two weeks ago. My wife and I were able to escape the children for a few days in the mountains for our 11th wedding anniversary and my 36th birthday. Now on with the SQL Query.
This query returns a per server count of alerts for the past day that has a repeat count higher than zero. (higher than zero, it happened more than one time and could possibly be a real problem.)
-- SQL CODE
-- Alerts past 1 day Part 1
-- Scott Moss 10/03/07
-- OnePoint DB MOM 2005
-- Count per computer the number of alerts with a repeat count greater than 0
-- and the TimeOfLastEvent the past 1 day.
SELECT [ComputerName], COUNT(*) AS AlertCount
FROM SDKAlertView
WHERE RepeatCount > 0
and (DateDiff(D, TimeOfLastEvent, GetDate()) <= 1)
GROUP BY ComputerName
ORDER BY AlertCount DESC