Page 1 of 5
Windows Service Monitoring
Posted: Tue Oct 06, 2020 6:51 am
by HBRMonitoring
Hi All,
I want to monitor a few Windows services from services.msc. Kindly let me know what is the procedure. I searched a lot of materials, but I am not able to get the needed results.
Re: Windows Service Monitoring
Posted: Tue Oct 06, 2020 4:49 pm
by benjaminsmith
Hi,
You can use the NCPA Agent to monitor Windows services. First install the NCPA agent on the window system, and then run the NCPA Windows to help get service checks setup.
NCPA Agent Installation Instructions
How To Monitor Devices Using The NCPA Agent and Wizard
Let us know if you're able to get it setup or if you have any questions.
--Benjamin
The NCPA API Reference
https://www.nagios.org/ncpa/help.php
A sample check command for checking a Windows service using NCPA.
Code: Select all
./check_ncpa.py -H 10.25.14.91 -t Str0ngT0k3n -M services -q service=Spooler,status=running
Re: Windows Service Monitoring
Posted: Thu Oct 08, 2020 5:50 am
by HBRMonitoring
Thanks Benjamin for the response.
We have installed NSClient++ for the windows servers and are monitoring few infra components of Windows OS. Can we also install NPCA agent too? being fairly new to Nagios, I am trying to understand things. Kindly help me.
Re: Windows Service Monitoring
Posted: Thu Oct 08, 2020 4:40 pm
by benjaminsmith
Hi,
Can we also install NPCA agent too? being fairly new to Nagios, I am trying to understand things. Kindly help me.
Yes. You can have both of them running on the same system without issue. I highly recommend using NCPA. It's our agent and it's fully supported by Nagios Enterprises.
Let us know if you have more questions.
Benjamin
Re: Windows Service Monitoring
Posted: Wed Nov 04, 2020 4:10 am
by HBRMonitoring
I got the NCPA agent installed and tried to monitor the W32Time service on a windows box, but its not working. I am getting the below error:
COMMAND: /usr/local/nagios/libexec/check_ncpa.py -H <my host FQDN is here> -t '<My token password>' -P 5693 -M 'service/W32Time/running' -v
OUTPUT: Connecting to: https://<my host FQDN is here>:5693/api/service/W32Time/running/?token=<My token password>&check=1
File returned contained:
{
"returncode": 3,
"stdout": "UNKNOWN: The node (service) requested does not exist. You may be trying to access the 'services' node."
}
An error occurred:'value'
Kindly help
Re: Windows Service Monitoring
Posted: Wed Nov 04, 2020 5:05 pm
by benjaminsmith
Hi,
Please try the following command and let me know if that works on your system. If not, post the output error to the thread. Thanks, Benjamin
Code: Select all
./check_ncpa.py -H <ip address> -t 'token' -M services -q service=W32Time,status=running
Reference
https://support.nagios.com/kb/article/s ... s-775.html
Re: Windows Service Monitoring
Posted: Fri Nov 06, 2020 1:46 am
by HBRMonitoring
I ran on the Nagios server as belwo
/usr/local/nagios/libexec/check_ncpa.py -H <IP_of_end_Server> -t 'token' -M services -q service=W32Time,status=running
UNKNOWN: Error occurred while running the plugin. Use the verbose flag for more details.
SHould I run this on end server too and check?
Re: Windows Service Monitoring
Posted: Fri Nov 06, 2020 12:03 pm
by benjaminsmith
HI,
Is NCPA running on the remote hosts, it looks like it's not connecting. Try running the command with the verbose option (-v):
Code: Select all
./check_ncpa.py -H <ip address> -t 'token' -M services -q service=W32Time,status=running -v
Can you run a simple version check against the host?
Code: Select all
./check_ncpa.py -H 192.168.254.119 -t 'token' -V
If that's not working try running curl command to test the connectivity.
Code: Select all
curl -k -L -v https://<ip address>:5693
Re: Windows Service Monitoring
Posted: Mon Nov 09, 2020 9:46 am
by HBRMonitoring
This is a windows server and I cant see the script check_ncpa.py.
Is this an issue? or is there any other command/script?
Re: Windows Service Monitoring
Posted: Mon Nov 09, 2020 4:00 pm
by benjaminsmith
HI,
This is a windows server and I cant see the script check_ncpa.py.
So, check_ncpa.py would actually be the script called on the Nagios XI side. This plugin will communicate directly with NCPA and get the results of the service check.
Open a terminal in Nagios XI and try running the plugin once more. If it fails, please post the output to the thread. Also, make sure you have the correct token to pass to NCPA.
Code: Select all
cd /usr/local/nagios/libexec/
./check_ncpa.py -H <ip address of Windows server> -t 'token' -M services -q service=W32Time,status=running -v