Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


fodder
2011-11-15T11:38:14Z
I have a few jobs that run every 30 seconds. Because of the frequency, it is not uncommon to have the jobs fail once or twice over the course of the day.

Is there a way I could have the application notify me of a job failure only after a set number of consecutive failures rather than after every failure?

If it fails once, but works the next time, then I don't care about the failure. I only care if it fails continuously.
Sponsor
Forum information
hawkings
2011-11-20T20:58:35Z
You need to add an extra job to announce multiple errors.
Example:

Job A: (The job that is repeated every 30 sec)
(task 1) Calculate variable: JobARepeatedFails = JobARepeatedFails + 1
(task 2) Do your thing
(task 3) Set JobARepeatedFails = 0 (this is not executed if task 2 fails)

Job B: (Repeated for example every 1 minute)
(task 1) Condition: If JobARepeatedFails > 3 => Send email

Useful?
fodder
2011-11-21T12:42:19Z
Your recommendation gave me what I needed. I use the variable as you suggested. However, instead of creating a separate job for the notification, I created a fourth task with a condition to check the value of the variable. If the value is >= 5, it executes the task to send a notification. If not, it exits the job.

Thanks for your help.
hawkings
2011-11-23T09:46:47Z
Your suggestion is of course much better. Just remember to set "Continue" on error for the 2nd task so it will have a chance to reach the 4th task. :-)

-René
fodder
2011-11-28T12:17:54Z
For the second task I have it set to skip to the 4th task on error. If I set it to continue, it would go to third task, which would reset the variable to 0 thereby causing the 4th task to never meet the condition for sending a notification.

On a side note, I think both methodologies (keeping everything contained to a single job and using a separate job for the notification) have merits. Keeping everything contained to one job is good for those who would want a notification after every failure once the threshhold has been met. Splitting the notification out to a separate job that runs on a timer is good for those would want periodic notification, but not necessarily after every single failure.

Personally, I am good with keeping it to one job because these jobs are important enough that if they fail continuously, I want to be nagged continuously until they are fixed. But if I didn't want the spam, using a separate job to reduce the quantity of notifications would be useful.
Scroll to Top