Page 1 of 1

How event handlers work and why timeout happens in execution

Posted: Tue Oct 24, 2017 2:38 am
by jenithangel
I have issues with nagios
-> event handler call for the 3rd time doesnt happen before the service reacheds CRITICAL HARD state

this is wat happents
1. event handler call with CRITICAL SOFT 1 - success but service is till doen
2. event handler call with CRITICAL SOFT 2 - call is success but app is down
3. event handler call with CRITICAL SOFT 3 doesnt happen.. error from nagios.log is as follows

[1508751396] SERVICE ALERT: localhost;xxx-service;CRITICAL;SOFT;3;CRITICAL - Socket timeout after 10 seconds
[1508751396] SERVICE EVENT HANDLER: localhost;xxx-service;CRITICAL;SOFT;3;recover-service!xx!xx!prod!xx!1.0.246!/TOMEE/instances/xx_1.0.246.pid
[1508751426] wproc: Core Worker 41603: job 239 (pid=6855) timed out. Killing it
[1508751426] wproc: SERVICE EVENTHANDLER job 239 from worker Core Worker 41603 timed out after 30.03s
[1508751426] wproc: early_timeout=1; exited_ok=0; wait_status=0; error_code=62;
[1508751426] Warning: Service event handler command '/u/gls/Monitoring/nagios/scripts/serviceRecovery.sh CRITICAL SOFT 3 ' timed out after 0.00 seconds
[1508751426] wproc: Core Worker 41603: job 239 (pid=6855): Dormant child reaped

the configuration file had 30 sec for event handler timeout .

Wanted to know why this event handler is getting timedout.. how to do that ?

Re: How event handlers work and why timeout happens in execu

Posted: Tue Oct 24, 2017 2:00 pm
by dwasswa
Hi @ jenithangel,

Can you please post how you defined the command for the event handle and in what directory its stored.

Please see example:

Code: Select all

define command {
    command_name    restart-httpd
    command_line    /usr/local/nagios/libexec/eventhandlers/restart-httpd  $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$
}
Yours seems to be stored in the wrong directory.

Re: How event handlers work and why timeout happens in execu

Posted: Tue Oct 24, 2017 11:18 pm
by jenithangel
Got it.. THanks.. You can close the pose..

Re: How event handlers work and why timeout happens in execu

Posted: Wed Oct 25, 2017 11:23 am
by dwasswa
Hi @ jenithangel,

Am glad i could help.

If you have any questions,please open a new thread.

Thank you for using the nagios support forum.