I'm trying to create an alert that will tell me if nightly database maintenance completed successfully or failed and how long from start to completion the maintenance job took.
I can find the events in Orion.Events, but not quite sure how to incorporate this into an alert. Trying to use Custom SQWL Event (Advanced) type of alert, but not quite sure of which of the available SWQL Conditions that will work.
Using this SWQL can give me the events in a table, but I'm looking how to use this in an alert.
SELECT
TOLOCAL(EventTime) AS LocalEventTime,
Message,
EventType
FROM Orion.Events
WHERE Message LIKE '%Starting Nightly Maintenance%'
OR Message LIKE '%Nightly maintenance failed%'
OR Message LIKE '%Nightly Maintenance Completed%'
ORDER BY EventTime DESC