Query about event handlers

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
caf_infra
Posts: 27
Joined: Wed Apr 20, 2016 10:41 am

Query about event handlers

Post by caf_infra »

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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Query about event handlers

Post by scottwilkerson »

caf_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.
This is exactly what I would do
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked