NAGIOS CORE EVENT HANDLER

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
ishtiaqa
Posts: 2
Joined: Tue Dec 13, 2016 6:47 am

NAGIOS CORE EVENT HANDLER

Post 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
Last edited by dwhitfield on Tue Dec 13, 2016 12:42 pm, edited 1 time in total.
Reason: code blocks FTW
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: NAGIOS CORE EVENT HANDLER

Post 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!
Last edited by dwhitfield on Wed Dec 14, 2016 12:29 pm, edited 1 time in total.
Reason: fixed my [b]
ishtiaqa
Posts: 2
Joined: Tue Dec 13, 2016 6:47 am

Re: NAGIOS CORE EVENT HANDLER

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: NAGIOS CORE EVENT HANDLER

Post 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.
Former Nagios Employee
Locked