Hi,
We need to check the status of a service on Windows/Linux and restart it based on corresponding startup script.
Is there a out of box solution in NagiosXI for this requirement?
Thanks,
Pavan.
Monitor A Service On Windows/Linux & Restart If Down
-
pavankumar
- Posts: 14
- Joined: Wed Aug 28, 2019 11:03 am
Re: Monitor A Service On Windows/Linux & Restart If Down
I believe you could achieve this by following the steps, outlined in our official documentation:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... h-NRPE.pdf
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
https://assets.nagios.com/downloads/nag ... h-NRPE.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
pavankumar
- Posts: 14
- Joined: Wed Aug 28, 2019 11:03 am
Re: Monitor A Service On Windows/Linux & Restart If Down
We are using NCPA.
Thanks
Thanks
Re: Monitor A Service On Windows/Linux & Restart If Down
The setup is still the same for the XI side.
The only differences on the NCPA side would be for you to put the plugin in the NCPA plugins directory on the server and the restart scripts would be:
- Note: Make sure to change the <your token> part
You can test from your XI server with this:
See here:
The only differences on the NCPA side would be for you to put the plugin in the NCPA plugins directory on the server and the restart scripts would be:
- Note: Make sure to change the <your token> part
Code: Select all
#!/bin/sh
case "$1" in
OK)
;;
WARNING)
;;
UNKNOWN)
;;
CRITICAL)
/usr/local/nagios/libexec/check_ncpa.py -H "$2" -t '<your token>' -M 'plugins/restart_service.bat' -q "args=$3"
;;
esac
exit 0Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -H X.X.X.X -t '<your token>' -M 'plugins/restart_service.bat' -q "args=spooler"Code: Select all
https://www.nagios.org/ncpa/help.php#api-modules-plugins