Windows Service Monitoring
-
HBRMonitoring
- Posts: 27
- Joined: Mon Oct 05, 2020 10:19 am
Re: Windows Service Monitoring
./check_ncpa.py -H 172.26.28.36 -t 'Admin@1234' -V
check_ncpa.py, Version 0.3.5
curl -k -L -v https://172.26.28.36:5693
* About to connect() to 172.26.28.36 port 5693 (#0)
* Trying 172.26.28.36... connected
* Connected to 172.26.28.36 (172.26.28.36) port 5693 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* NSS error -12190
* Closing connection #0
* SSL connect error
curl: (35) SSL connect error
/usr/local/nagios/libexec/check_ncpa.py -H 172.26.28.36 -t 'Admin@1234' -M services -q service=W32Time,status=running -v
Connecting to: https://172.26.28.36:5693/api/services/ ... ce=W32Time
File returned contained:
{
"returncode": 0,
"stdout": "OK: W32Time is running"
}
An error occurred:'value'
check_ncpa.py, Version 0.3.5
curl -k -L -v https://172.26.28.36:5693
* About to connect() to 172.26.28.36 port 5693 (#0)
* Trying 172.26.28.36... connected
* Connected to 172.26.28.36 (172.26.28.36) port 5693 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* NSS error -12190
* Closing connection #0
* SSL connect error
curl: (35) SSL connect error
/usr/local/nagios/libexec/check_ncpa.py -H 172.26.28.36 -t 'Admin@1234' -M services -q service=W32Time,status=running -v
Connecting to: https://172.26.28.36:5693/api/services/ ... ce=W32Time
File returned contained:
{
"returncode": 0,
"stdout": "OK: W32Time is running"
}
An error occurred:'value'
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Windows Service Monitoring
HI,
While it is actaully returning the result we would expect, you're getting an SSL error.
What version of curl do you have installed on the server? They maybe out of date.
While it is actaully returning the result we would expect, you're getting an SSL error.
Code: Select all
curl: (35) SSL connect error
Code: Select all
rpm -qa | grep curl
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
HBRMonitoring
- Posts: 27
- Joined: Mon Oct 05, 2020 10:19 am
Re: Windows Service Monitoring
-bash-4.1$ ./check_ncpa.py -H 172.26.28.36 -t 'Admin@1234' -M services -q service=W32Time,status=running -v
Connecting to: https://172.26.28.36:5693/api/services/ ... ce=W32Time
File returned contained:
{
"returncode": 0,
"stdout": "OK: W32Time is running"
}
An error occurred:'value'
-bash-4.1$ rpm -qa | grep curl
libcurl-7.19.7-46.el6.x86_64
python-pycurl-7.19.0-8.el6.x86_64
curl-7.19.7-46.el6.x86_64
Connecting to: https://172.26.28.36:5693/api/services/ ... ce=W32Time
File returned contained:
{
"returncode": 0,
"stdout": "OK: W32Time is running"
}
An error occurred:'value'
-bash-4.1$ rpm -qa | grep curl
libcurl-7.19.7-46.el6.x86_64
python-pycurl-7.19.0-8.el6.x86_64
curl-7.19.7-46.el6.x86_64
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Windows Service Monitoring
Hi @HBRMonitoring,
While there does seem to be an issue with curl negotiating over SSL, the check results are coming back as expected.
We recommend updating the check_ncpa plugin on the XI server as it's out of date. You can download the plugin from this link.
To set the proper permissions.
Please try setting up the checks on the Nagios XI server and let me know if they are working successfully.
While there does seem to be an issue with curl negotiating over SSL, the check results are coming back as expected.
We recommend updating the check_ncpa plugin on the XI server as it's out of date. You can download the plugin from this link.
Code: Select all
wget https://assets.nagios.com/downloads/ncpa/check_ncpa.tar.gz
Code: Select all
chown apache:nagios /usr/local/nagios/libexec/check_ncpa.py
chmod 775 /usr/local/nagios/libexec/check_ncpa.py
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
HBRMonitoring
- Posts: 27
- Joined: Mon Oct 05, 2020 10:19 am
Re: Windows Service Monitoring
Hi,
I should be running this on the Nagios server, isnt it?
I already see one there.
/usr/local/nagios/libexec/check_ncpa.py
-rwxr-xr-x. 1 nagios nagios 9332 Jan 19 2016 /usr/local/nagios/libexec/check_ncpa.py
1. Is it okay to upgrade?
2. Are there any impact on the existing NCPA monitoring?
3. How do I check where the NCPA monitoring is used (is there a way I can check if this command is used in any service and the service is deployed on any host) ? If they are not used, I can upgrade easily, else I need to take permission from business to do so.
I should be running this on the Nagios server, isnt it?
I already see one there.
/usr/local/nagios/libexec/check_ncpa.py
-rwxr-xr-x. 1 nagios nagios 9332 Jan 19 2016 /usr/local/nagios/libexec/check_ncpa.py
1. Is it okay to upgrade?
2. Are there any impact on the existing NCPA monitoring?
3. How do I check where the NCPA monitoring is used (is there a way I can check if this command is used in any service and the service is deployed on any host) ? If they are not used, I can upgrade easily, else I need to take permission from business to do so.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Windows Service Monitoring
Hi,
Yes, you can upgrade the plugin and it should not impact any hosts running older versions of the NCPA agent. Since it's only a plugin, I would make a backup of the older version on the server, so you can copy that back over if needed.
There isn't a direct way to query all the services running a specific plugin in the CCM. However, the following API call will return a list of all the services and config settings ( host checks typically just use check_http or check_ping).
You can either search through the output or save the output to a file and import this into a spreadsheet and sort. It's possible to import json data using Excel.
Let me know if you need further assistance.
Benjamin
Yes, you can upgrade the plugin and it should not impact any hosts running older versions of the NCPA agent. Since it's only a plugin, I would make a backup of the older version on the server, so you can copy that back over if needed.
There isn't a direct way to query all the services running a specific plugin in the CCM. However, the following API call will return a list of all the services and config settings ( host checks typically just use check_http or check_ping).
Code: Select all
curl -XGET "https://192.168.23.112/nagiosxi/api/v1/config/service?apikey=<your API key>&check_command=check_xi_ncpa&pretty=1Let me know if you need further assistance.
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
HBRMonitoring
- Posts: 27
- Joined: Mon Oct 05, 2020 10:19 am
Re: Windows Service Monitoring
Hi Benjamin,
Please find below details and screenshots
/usr/local/nagios/libexec/check_ncpa.py -H 172.26.28.36 -t '"<token>' -M services -q service=W32Time,status=running -v
Connecting to: https://172.26.28.36:5693/api/services/ ... us=running
File returned contained:
{
"returncode": 0,
"stdout": "OK: W32Time is running"
}
OK: W32Time is running
/usr/local/nagios/libexec/check_ncpa.py -H <IP> -t '<token>' -V
check_ncpa.py, Version 1.2.3
Kindly let me know if this is all good and if I can proceed to monitor the W32Time service on all the Windows box.
Please find below details and screenshots
/usr/local/nagios/libexec/check_ncpa.py -H 172.26.28.36 -t '"<token>' -M services -q service=W32Time,status=running -v
Connecting to: https://172.26.28.36:5693/api/services/ ... us=running
File returned contained:
{
"returncode": 0,
"stdout": "OK: W32Time is running"
}
OK: W32Time is running
/usr/local/nagios/libexec/check_ncpa.py -H <IP> -t '<token>' -V
check_ncpa.py, Version 1.2.3
Kindly let me know if this is all good and if I can proceed to monitor the W32Time service on all the Windows box.
You do not have the required permissions to view the files attached to this post.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Windows Service Monitoring
Hi @HBRMonitoring,
Thanks for posting that screenshot. Looks like the check results are being processed successfully.
Benjamin
Thanks for posting that screenshot. Looks like the check results are being processed successfully.
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
HBRMonitoring
- Posts: 27
- Joined: Mon Oct 05, 2020 10:19 am
Re: Windows Service Monitoring
Yes, but the issue is on a few Windows servers, I am not getting the output, instead getting error as below
COMMAND: /usr/local/nagios/libexec/check_ncpa.py -H <server FQDN> -t '<token>' -P 5693 -M 'services' -q 'service=w32time,status=running'
OUTPUT: UNKNOWN: Execution exceeded timeout threshold of 60s
Same error even if I use IP Address too instead of FQDN.
I also tried the service name as W32Time, still it is the same issue on these set of servers.
Few of these servers are Prod, few as Non-Prod. so, nothing in common among the servers
I also gave -T 120, still getting timeout error, but a little different
COMMAND: /usr/local/nagios/libexec/check_ncpa.py -H <Server FQDN> -t '<token>' -P 5693 -M 'services' -q 'service=W32Time,status=running' -T 120
OUTPUT: UNKNOWN: An error occured connecting to API. (Connection error: '[Errno 110] Connection timed out')
Same error even if I use IP Address too instead of FQDN.
COMMAND: /usr/local/nagios/libexec/check_ncpa.py -H <server FQDN> -t '<token>' -P 5693 -M 'services' -q 'service=w32time,status=running'
OUTPUT: UNKNOWN: Execution exceeded timeout threshold of 60s
Same error even if I use IP Address too instead of FQDN.
I also tried the service name as W32Time, still it is the same issue on these set of servers.
Few of these servers are Prod, few as Non-Prod. so, nothing in common among the servers
I also gave -T 120, still getting timeout error, but a little different
COMMAND: /usr/local/nagios/libexec/check_ncpa.py -H <Server FQDN> -t '<token>' -P 5693 -M 'services' -q 'service=W32Time,status=running' -T 120
OUTPUT: UNKNOWN: An error occured connecting to API. (Connection error: '[Errno 110] Connection timed out')
Same error even if I use IP Address too instead of FQDN.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Windows Service Monitoring
HI,
It looks like there's a firewall or other connection issue between XI and those Windows servers. Make the service is running on those hosts and then that the connection is not being blocked by a firewall.
Configuring the firewall for Windows is on page 13 of the following guide.
https://assets.nagios.com/downloads/ncp ... g-NCPA.pdf
Try testing the connectivity again with a curl command.
It looks like there's a firewall or other connection issue between XI and those Windows servers. Make the service is running on those hosts and then that the connection is not being blocked by a firewall.
Configuring the firewall for Windows is on page 13 of the following guide.
https://assets.nagios.com/downloads/ncp ... g-NCPA.pdf
Try testing the connectivity again with a curl command.
Code: Select all
curl -k -L -v https://<ip address>:5693
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!