i am getting below error while running event handler on Nagios core:
[1410418646] SERVICE EVENT HANDLER: eej758;Remote check disk;CRITICAL;SOFT;1;myhandler
[1410418646] wproc: SERVICE EVENTHANDLER job 96 from worker Core Worker 22957 is a non-check helper but exited with return code 2
can anyone help me with this issue?
SERVICE EVENTHANDLER job 96 from worker Core Worker 22957 is
Re: SERVICE EVENTHANDLER job 96 from worker Core Worker 2295
This usually means a script/executable in the command_line of the eventhandler command definition can't be found (Edit: or the command isn't a valid shell command, check for typos, missing quotes, unescaped special characters). It's a good idea to use the full path to scripts, you can use the $USER1$ macro for executables in /usr/local/nagios/libexec. On my test system I have an eventhandler command defined like this:arushgiri wrote:[1410418646] wproc: SERVICE EVENTHANDLER job 96 from worker Core Worker 22957 is a non-check helper but exited with return code 2
Code: Select all
define command {
command_name service-event-handler-command
command_line $USER1$/eventhandlers/service-event-handler $HOSTNAME$ $HOSTDISPLAYNAME$ $HOSTADDRESS$ $SERVICEDESC$ $SERVICEDISPLAYNAME$ $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$
}Re: SERVICE EVENTHANDLER job 96 from worker Core Worker 2295
Thanks for reply. this is the command definition m using:
define command{
command_name myhandler
command_line /usr/local/nagios/libexec/eventhandlers/myhandler.sh $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$
}
define command{
command_name myhandler
command_line /usr/local/nagios/libexec/eventhandlers/myhandler.sh $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$
}
Re: SERVICE EVENTHANDLER job 96 from worker Core Worker 2295
What are the permissions of the script?
Code: Select all
ls -la /usr/local/nagios/libexec/eventhandlers/myhandler.shBe sure to check out our Knowledgebase for helpful articles and solutions!