EVENT HANDLER NAGIOS / NAGIOSSQL RUNS BUT NOTHING HAPPENS
Posted: Fri May 05, 2017 11:57 am
Hello,
First.. YES.. I did try and look through the articles but did not find anything that worked for me. And YES it is possible I missed some good articles.. I know NagiosSQL is not your product but I am expecting that the result would likely be the same regardless of the event handler being in nagiossql or nagios
Here is my issue if anyone can help..
I need to restart a windows service (remotely.. not executed from a .sh script in nagios). I have it setup as follows:
* In NagioSQL I have a check command called "Check_Printer_Restart" ( /usr/local/nagios/libexec/check_nrpe -H $ARG1$ -c get_restart)
* On the windows server, I have a batch file and the config points to the proper location to restart a service
* In NagioSQL I have the service template configured to use the Event Handler check command above
* I have Event Handling enabled
* If I sudo to nagios and execute the command manually, that works too.
So if I run the command manually from the nagios box it works and stops the Windows service ( I say stop and not restart because I want to make sure it is working and not restarting before I catch it)
"/usr/lib64/nagios/plugins/check_nrpe -H x.x.x.x -c get_restart"
If I let the service run and try and have it do it on it's normal check, I see the output below in the nagios.log
"SERVICE EVENT HANDLER: MYSERVER;HTTP;OK;HARD;3;check_printer_restart"
So I see it says it executed.. but that is all I get log wise.. On the windows server, it never executes. I'm also trying to have this happen on the hard 3rd final attempt but for now I just need to get it to execute. Thanks!
First.. YES.. I did try and look through the articles but did not find anything that worked for me. And YES it is possible I missed some good articles.. I know NagiosSQL is not your product but I am expecting that the result would likely be the same regardless of the event handler being in nagiossql or nagios
Here is my issue if anyone can help..
I need to restart a windows service (remotely.. not executed from a .sh script in nagios). I have it setup as follows:
* In NagioSQL I have a check command called "Check_Printer_Restart" ( /usr/local/nagios/libexec/check_nrpe -H $ARG1$ -c get_restart)
* On the windows server, I have a batch file and the config points to the proper location to restart a service
* In NagioSQL I have the service template configured to use the Event Handler check command above
* I have Event Handling enabled
* If I sudo to nagios and execute the command manually, that works too.
So if I run the command manually from the nagios box it works and stops the Windows service ( I say stop and not restart because I want to make sure it is working and not restarting before I catch it)
"/usr/lib64/nagios/plugins/check_nrpe -H x.x.x.x -c get_restart"
If I let the service run and try and have it do it on it's normal check, I see the output below in the nagios.log
"SERVICE EVENT HANDLER: MYSERVER;HTTP;OK;HARD;3;check_printer_restart"
So I see it says it executed.. but that is all I get log wise.. On the windows server, it never executes. I'm also trying to have this happen on the hard 3rd final attempt but for now I just need to get it to execute. Thanks!