I'm using a SQL task to query and send an email if any rows are returned.
This is working well.
However, if the SQL task runs every 15 minutes - I do not want to send an email every 15 minutes.
If a notification is sent, I would like to pause the monitor for say 4 hours and then resume the SQL monitor.
I tried using a user variable with holding a next run time -- but user variables and conditions don't seem to support dates very well and I didn't get very far. I could calculate the date that I wanted to resume running the monitor, but I couldn't figure out how to build a condition that would use that variable. Is there a way to compare a user variable of a date/time to the current date/time and check if the current date/time is greater?
I was able to put this together which works - but seems odd:
Job: Monitor Database run every 15 minutes
Task: Run Query - Flow - On Success if Result.NoRows = 0 Stop Job
Task: Send Email
Task: Wait - 4 hours.
This works - if there are no rows, the job finishes quickly and will run again in 15 minutes.
If there are rows, then the wait task will run for 4 hours and no notifications would be sent.
It seems odd to see a task 'running' when its not really doing anything.
Perhaps that isn't such a big deal, but if we have dozens or hundreds of monitors in this delay task - would that tie up server resources??