Event hanler not executing continously

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
venkitesh
Posts: 67
Joined: Tue Jan 27, 2015 12:34 am

Event hanler not executing continously

Post by venkitesh »

Hi Team,

i have configured a linux based sms gateway to send sms alerts if a host is down.

i have created a new misc command and put it as an event handler.

so if a host is down, it will execute that event handler and sms is coming.

I have given recheck interval as 10 minutes. so it checks all hosts for every 10 minutes and if a host is down, it will send sms every 10 minutes.

Now the issue is if a host is down for say around 2 hrs, it is triggering sms for around 2 checks. after that it is not executing the event handler.

But i want to be in such a way it has to trigger the event handler every 10 minutes, until the host is up.

Please advise.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Event hanler not executing continously

Post by abrist »

Event handlers, by default, only run when a HARD state change occurs. By enabling "is_volatile", nagios will treat every check as a state change which will in turn run the event handler every check. This is the suggested way, but you need to stop the event handler from running when the state is OK/UP. You will need to pass the object state macro to your event handler script so that the script can check to see if it is a problem state before continuing, if it is not a problem state, it should exit.

Does this make sense?
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.
Locked