Page 1 of 1

NAGIOS CORE EVENT HANDLER

Posted: Tue Dec 13, 2016 6:56 am
by ishtiaqa
I have one question regarding EVENT HANDLER

I have already configured event handler with HTTP and its is working fine ... i.e. restarting http remote service by nagios server .
Now i want to restart the remote nrpe service via nagios server , as i have made a scripts as well , which is working fine manually . but not working with nagios .
I want to confirm the command_line variables would be used in it .

Code: Select all

define command {
       command_name     restart-service
       command_line     /usr/local/nagios/libexec/event_handler/event_handler_script.sh [b]$SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ $HOSTADDRESS$ $ARG1$ $SERVICEDESC$ $MAXSERVICEATTEMPTS   
}
Confuesed about the variable i have to used in it
Can any one confirm me ?

Regards,
Ishtiaq Ahmed

Re: NAGIOS CORE EVENT HANDLER

Posted: Tue Dec 13, 2016 12:49 pm
by dwhitfield
It sounds like you have a, um, handle on things, but documentation is at https://assets.nagios.com/downloads/nag ... dlers.html

What version of Core are you using? Was it compiled from source or installed from distro repos? On what OS/version is nagios running? cat /etc/*-release may be of use.

So, now to address the issue at hand directly...can you confirm that the is a failed bold tag? Is that in your command? I see no closing [ /b ], so just want to be sure. Thanks!

Re: NAGIOS CORE EVENT HANDLER

Posted: Wed Dec 14, 2016 2:44 am
by ishtiaqa
Dear dwhitfield,

Thanks for your prompt response.
Let me reply as per you asked .

1) i have used the same document to implement httpd restart and i got succeed and all this is for local one , not for remote httpd .My task is to implement the same for remote nrpe restart . i.e. when any remote nrpe server gets down then via nagios event handler it should get start and from this way it is not getting implemented .

2) NAGIOS core version is 4.2.0
3) Centos 6.5
4) Installed via source
5) So, now to address the issue at hand directly...can you confirm that the is a failed bold tag? Is that in your command? I see no closing --- did not understand.

NRPE RESTART IS NOT WORKING IN SAME WAY.

Re: NAGIOS CORE EVENT HANDLER

Posted: Wed Dec 14, 2016 12:47 pm
by rkennedy
1. How is your event handler working to start the service? Are you using NRPE or check_by_ssh? If the NRPE service is stopped, and you expect event handlers to start it again using NRPE - this won't work.
Now i want to restart the remote nrpe service via nagios server , as i have made a scripts as well , which is working fine manually . but not working with nagios .
2. If the script works from the CLI, take a look at the permissions on /usr/local/nagios/libexec/event_handler/event_handler_script.sh and usr/local/nagios/libexec/event_handler/ - make sure the nagios user can run it.