Is there a way to get an event handler to run again after a certain period of time?
Example:
We are using the Windows Service Restart event handler provided by Nagios. However sometimes there's lag or whatnot and it fails to effectively restart the service.
Would like to have a way that if after X amount of time, if the service has not recovered, the event handler will run again.
Is there an easy way of doing this?
Thanks,
Chris
Secondary event handlers
Re: Secondary event handlers
One idea: You could sleep the event handler script for a few minutes and then have it recheck. If the service is still down, try to restart it and sleep again, if it is up, exit out of the script.
You could alternatively make the check volatile, and add logic to the beginning of the script to check if the service is down. If it is down, the script will restart it, if it is up, the script will exit. By setting the check to volatile, the event handler will run on every check so you have to make sure your event handler script has some logic to deal with that.
You could alternatively make the check volatile, and add logic to the beginning of the script to check if the service is down. If it is down, the script will restart it, if it is up, the script will exit. By setting the check to volatile, the event handler will run on every check so you have to make sure your event handler script has some logic to deal with that.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.