Hi,
I'm in the process of setting up an event handler that when the CPU on a server hits 100% it stops and restarts a service on the server.
Everything works, but as the service may take longer to stop and restart than Nagios's check interval, I don't want the script to fire off again if the CPU is still 100%.
I've done it programmatically in the batch file that gets run by having it create a file when it starts and skip to eof if it gets called again and that file exists, as well as having a 90 second delay between the stopping and starting of the service, but was wondering if there was a more elegant way of doing it.
Thanks
Query about event handlers
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Query about event handlers
This is exactly what I would docaf_infra wrote:I've done it programmatically in the batch file that gets run by having it create a file when it starts and skip to eof if it gets called again and that file exists, as well as having a 90 second delay between the stopping and starting of the service, but was wondering if there was a more elegant way of doing it.