I am currently using Nagios XI 5.7.5 and am trying to set up a service (RLM) to restart when it is not available. I believe I have configured it correctly, and am able to execute the ./check_ncpa.py -H 10.25.14.3 -P 5693 -t Str0ngT0k3n -M 'plugins/restart_service.bat' -a RLM and /usr/local/nagios/libexec/restart_service.sh CRITICAL 10.25.14.3 Str0ngT0k3n RLM from the command line. I added Service Restart - WIndows to Commands as a Misc command type, and checked Active. On the Check Settings tab of the Service I set the Event Handler dropdown as Service Restart - Windows, and set Event handler enabled to On. On the Manage Free Variables window I ser _xwizart to ncpa, and _service to RLM. I turned off the RLM service on the Windows server, and Nagios reports that the service is down. However, the service fails to restart. Am I doing something wrong? I pretty much tried for 6 hours last Friday to get it to work.
NCPA service event handler not working
NCPA service event handler not working
All,
I am currently using Nagios XI 5.7.5 and am trying to set up a service (RLM) to restart when it is not available. I believe I have configured it correctly, and am able to execute the ./check_ncpa.py -H 10.25.14.3 -P 5693 -t Str0ngT0k3n -M 'plugins/restart_service.bat' -a RLM and /usr/local/nagios/libexec/restart_service.sh CRITICAL 10.25.14.3 Str0ngT0k3n RLM from the command line. I added Service Restart - WIndows to Commands as a Misc command type, and checked Active. On the Check Settings tab of the Service I set the Event Handler dropdown as Service Restart - Windows, and set Event handler enabled to On. On the Manage Free Variables window I ser _xwizart to ncpa, and _service to RLM. I turned off the RLM service on the Windows server, and Nagios reports that the service is down. However, the service fails to restart. Am I doing something wrong? I pretty much tried for 6 hours last Friday to get it to work.
I am currently using Nagios XI 5.7.5 and am trying to set up a service (RLM) to restart when it is not available. I believe I have configured it correctly, and am able to execute the ./check_ncpa.py -H 10.25.14.3 -P 5693 -t Str0ngT0k3n -M 'plugins/restart_service.bat' -a RLM and /usr/local/nagios/libexec/restart_service.sh CRITICAL 10.25.14.3 Str0ngT0k3n RLM from the command line. I added Service Restart - WIndows to Commands as a Misc command type, and checked Active. On the Check Settings tab of the Service I set the Event Handler dropdown as Service Restart - Windows, and set Event handler enabled to On. On the Manage Free Variables window I ser _xwizart to ncpa, and _service to RLM. I turned off the RLM service on the Windows server, and Nagios reports that the service is down. However, the service fails to restart. Am I doing something wrong? I pretty much tried for 6 hours last Friday to get it to work.
Re: NCPA service event handler not working
I have also checked the /usr/local/nagios/var/nagios.log for errors. Could not find any.
Re: NCPA service event handler not working
Please send a copy of your profile.zip, you can download it from Admin > System Profile by clicking the Download Profile button.
Please attach this file:
Include the output of this command:
Please attach this file:
Code: Select all
/usr/local/nagios/libexec/restart_service.shCode: Select all
ls -l /usr/local/nagios/libexec/restart_service.shRe: NCPA service event handler not working
Have you received my last post? I sent it this past Wednesday.
Re: NCPA service event handler not working
The script expects four arguments but the command is only passing three:
It should be this:
Try that and see if it resolves the issue.
Code: Select all
define command {
command_name Service Restart - Windows
command_line $USER1$/restart_service.sh $SERVICESTATE$ $HOSTADDRESS$ $_SERVICESERVICE$
}Code: Select all
define command {
command_name Service Restart - Windows
command_line $USER1$/restart_service.sh $SERVICESTATE$ $HOSTADDRESS$ 'your_NCPA_token' $_SERVICESERVICE$
}Re: NCPA service event handler not working
Please feel free to close this case. I finally figured out that the restart_service.sh script did not contain the token.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: NCPA service event handler not working
Great!HIINNS wrote:Please feel free to close this case. I finally figured out that the restart_service.sh script did not contain the token.
Locking thread