Page 1 of 1

Nagios XI and NCPA

Posted: Fri Feb 09, 2018 8:37 am
by robatwork
Hello,
Having been pointed away from NPRE and towards NCPA to monitor my Windows 2012 server, I have a simple query that I can't seen addressed int eh docs.

Can I restart a windows service if it, for example, goes above a certain CPU threshold?

thanks
Rob

Re: Nagios XI and NCPA

Posted: Fri Feb 09, 2018 8:43 am
by dwhitfield
Why not just use NSClient .4.4? That works for you, correct? Here's the previous thread: https://support.nagios.com/forum/viewtopic.php?t=47359

Re: Nagios XI and NCPA

Posted: Fri Feb 09, 2018 9:01 am
by robatwork
I didn't manage to get the services restarted using NSclient++ so I thought I'd try your supported client as advised - if it can't do service restarts then I will persevere with NSClient++

So can you control windows services with NCPA?

Re: Nagios XI and NCPA

Posted: Fri Feb 09, 2018 10:40 am
by npolovenko
@robatwork, Here's a tutorial on how to restart a windows service using NRPE part of the NSClient++
https://assets.nagios.com/downloads/nag ... 2hEALw_wcB
You could also create an event handler to do this automatically:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Let me know if you'd like me to assist you with NSCLient + NRPE, or if you'd like to go with NCPA instead.

Re: Nagios XI and NCPA

Posted: Fri Feb 09, 2018 11:29 am
by robatwork
npolovenko wrote:@robatwork, Here's a tutorial on how to restart a windows service using NRPE part of the NSClient++
https://assets.nagios.com/downloads/nag ... 2hEALw_wcB
You could also create an event handler to do this automatically:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Let me know if you'd like me to assist you with NSCLient + NRPE, or if you'd like to go with NCPA instead.
Hi- thanks for the reply. Just for clarity - NCPA can't restart services?

Re: Nagios XI and NCPA

Posted: Fri Feb 09, 2018 12:08 pm
by npolovenko
@robatwork, You can. It works differently on NCPA. You'd write a plugin that restarts windows services and put in the plugins directory on a windows server. Then you'd use the following command:

Code: Select all

https://localhost:5693/api/plugins/<plugin name>/<arg1>/<arg2>/?token=mytoken
or

Code: Select all

check_ncpa.py -H my.host.com -t mytoken -M 'plugins/restart_service.bat'