Using Event Handler to Restart Windows Services
Posted: Mon Mar 29, 2021 8:25 pm
Hi Guys,
Hoping you can help me with this.
I've followed the Guide to using the event Handler to Restart Windows Services using NCPA
https://assets.nagios.com/downloads/nag ... h-NCPA.pdf
I seem to have all the NCPA Side working, I can use the Command Line on the NagiosXi Box to restart the Services
[root@auqlddcnms1di libexec]# /usr/local/nagios/libexec/restart_service.sh CRITICAL 10.203.3.156 XXXXXXX spooler
The Print Spooler service is stopping.
The Print Spooler service was stopped successfully.
The Print Spooler service is starting.
The Print Spooler service was started successfully.
You have mail in /var/spool/mail/root
I have configured the Command in Core Configurator
Name: Service Restart - Windows
Command: $USER1$/restart_service.sh $SERVICESTATE$ $HOSTADDRESS$ XXXXXXXXX $_SERVICESERVICE$[/i
and have then setup the event handling on a service.
Event handler = Service Restart - Windows
Event handler enabled = on
and have set the Free variables as such
name: _service
Value: OpenDNS
This is the Shortname assigned to the Service I'm trying to restart. The Sevice Goes down, but the Event handler doesnt seem to fire as far as I can see. The service certainly doesnt start again.
Any Ideas what I can do to trouble shoot this one?
Matthew
Hoping you can help me with this.
I've followed the Guide to using the event Handler to Restart Windows Services using NCPA
https://assets.nagios.com/downloads/nag ... h-NCPA.pdf
I seem to have all the NCPA Side working, I can use the Command Line on the NagiosXi Box to restart the Services
[root@auqlddcnms1di libexec]# /usr/local/nagios/libexec/restart_service.sh CRITICAL 10.203.3.156 XXXXXXX spooler
The Print Spooler service is stopping.
The Print Spooler service was stopped successfully.
The Print Spooler service is starting.
The Print Spooler service was started successfully.
You have mail in /var/spool/mail/root
I have configured the Command in Core Configurator
Name: Service Restart - Windows
Command: $USER1$/restart_service.sh $SERVICESTATE$ $HOSTADDRESS$ XXXXXXXXX $_SERVICESERVICE$[/i
and have then setup the event handling on a service.
Event handler = Service Restart - Windows
Event handler enabled = on
and have set the Free variables as such
name: _service
Value: OpenDNS
This is the Shortname assigned to the Service I'm trying to restart. The Sevice Goes down, but the Event handler doesnt seem to fire as far as I can see. The service certainly doesnt start again.
Any Ideas what I can do to trouble shoot this one?
Matthew