ncpa passive checks not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jcwuerfl
Posts: 76
Joined: Tue Jun 10, 2014 12:44 pm

ncpa passive checks not working

Post by jcwuerfl »

We have the 1.1 ncpa client and Nagios XI 2014R1.1 server version. I was trying to find a newer linux/windows client but the ncpa download site doesn't really tell you what version it is?

Anyway, I am doing this passive check with that agent and on the nagios server side it just says: "no check results for service yet..."

I have added the passive check on the server side via the wizard.

Here is the client ncpa.cfg:

Code: Select all

[listener]
uid = root
certificate = adhoc
loglevel = debug
ip = 0.0.0.0
gid = root
port = 5693
logfile = var/ncpa_posix_listener.log
pidfile = var/ncpa_posix_listener.pid

[passive]
uid = nagios
handlers = nrdp
loglevel = debug
gid = nagcmd
sleep = 5
logfile = var/ncpa_posix_passive.log
pidfile = var/ncpa_posix_passive.pid

[nrdp]
token = thetoken
hostname = hostname.domain.com
parent = http://hostname.domain.com/nrdp/

[api]
community_string = thecommunitystring

[plugin directives]
plugin_path = plugins/
.sh = /bin/sh $plugin_name $plugin_args
.ps1 = powershell -ExecutionPolicy Unrestricted $plugin_name $plugin_args
.vbs = cscript $plugin_name $plugin_args //NoLogo

[passive checks]
hostname.domain.com|cpu usage = /cpu/percent --warning 80 --critical 90
hostname.domain.com|swap usage = /memory/swap/percent --warning 80 --critical 90
hostname.domain.com|memory usage = /memory/virtual/percent --warning 80 --critical 90
hostname.domain.com|disk-root-used-percent = /disk/logical/|/used_percent --warning 80 --critical 90

The last one is specifically what I added but isn't working.


Any ideas ?

Thanks!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: ncpa passive checks not working

Post by tmcdonald »

Go to Configure -> Unconfigured Objects. Is anything listed there?
Former Nagios employee
jcwuerfl
Posts: 76
Joined: Tue Jun 10, 2014 12:44 pm

Re: ncpa passive checks not working

Post by jcwuerfl »

There are quite a few in there but doesn't seem like the one I am looking for. If I clear those out for now will those come back ?
jcwuerfl
Posts: 76
Joined: Tue Jun 10, 2014 12:44 pm

Re: ncpa passive checks not working

Post by jcwuerfl »

Also, here is what I see on the cilent side in the passive log file... for the one check:

....
2014-06-10 15:17:35,305 13689 DEBUG Accessing internal API with accessor /disk/logical/|/used_percent?warning=80&critical=90&unit=
2014-06-10 15:17:35,305 13689 DEBUG Accessor result!
2014-06-10 15:17:35,305 13689 DEBUG Accessing internal API with accessor disk/logical/|/used_percent
2014-06-10 15:17:35,305 13689 DEBUG Using
2014-06-10 15:17:35,306 13689 DEBUG Reponse from server: {'returncode': 0, 'stdout': "OK: Used_percent was 8.4%|'used_percent_0'=8.4%;80;90"}
2014-06-10 15:17:35,306 13689 DEBUG Parsing arguments: --warning 80 --critical 90
2014-06-10 15:17:35,306 13689 DEBUG String args: ['./xxx', '--warning', '80', '--critical', '90']
....
....
2014-06-10 15:17:36,328 13689 INFO Message from NRDP server: OK
2014-06-10 15:17:36,329 13689 INFO Meta output from NRDP server: 4 checks processed.
2014-06-10 15:17:36,329 13689 DEBUG Successfully ran handler nrdp
jcwuerfl
Posts: 76
Joined: Tue Jun 10, 2014 12:44 pm

Re: ncpa passive checks not working

Post by jcwuerfl »

I see this in the host event log though. But if this is the check coming back why wouldn't the hostname be in there ?

Code: Select all

2014-06-10 15:44:46   Error: Got host check result for '', but no such host can be found
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: ncpa passive checks not working

Post by lmiltchev »

[passive checks]
hostname.domain.com|cpu usage = /cpu/percent --warning 80 --critical 90
hostname.domain.com|swap usage = /memory/swap/percent --warning 80 --critical 90
hostname.domain.com|memory usage = /memory/virtual/percent --warning 80 --critical 90
hostname.domain.com|disk-root-used-percent = /disk/logical/|/used_percent --warning 80 --critical 90
Try replacing the "hostname.domain.com" with "%HOSTNAME%", for example:

Code: Select all

%HOSTNAME%|cpu usage = /cpu/percent --warning 80 --critical 90
Save ncpa.cfg and exit. Restart both NCPA services (Listener & Passive).

If this is not fixing your issue, post the "ncpa_passive.log".
Be sure to check out our Knowledgebase for helpful articles and solutions!
jcwuerfl
Posts: 76
Joined: Tue Jun 10, 2014 12:44 pm

Re: ncpa passive checks not working

Post by jcwuerfl »

I have tried that but that also doesn't seem to work. Here is the output. I did change what the real host name is to: hostname.domain.com in the following.

Thanks

Code: Select all

2014-06-12 12:53:24,832 20117 INFO started
2014-06-12 12:53:24,834 20117 DEBUG Parsing config...
2014-06-12 12:53:24,834 20117 DEBUG Parsing commands...
2014-06-12 12:53:24,835 20117 DEBUG Parsing new individual command.
2014-06-12 12:53:24,835 20117 INFO Hostname is being assigned as the domain name of this computer.
2014-06-12 12:53:24,835 20117 INFO HOSTNAME was not explicitly declared. Using hostname.domain.com
2014-06-12 12:53:24,835 20117 DEBUG Setting hostname to hostname.domain.com and servicename to disk-root-used-percent
2014-06-12 12:53:24,835 20117 DEBUG Parsing command: /disk/logical/|/used_percent --warning 80 --critical 90
2014-06-12 12:53:24,835 20117 DEBUG Command contained arguments.
2014-06-12 12:53:24,835 20117 DEBUG Command to be run: Nagios Hostname: hostname.domain.com -- Nagios Servicename: disk-root-used-percent -- Command: /disk/logical/|/used_percent -- Arguments: --warning 80 --critical 90 -- Stdout: None -- Return Code: None
2014-06-12 12:53:24,836 20117 DEBUG Parsing new individual command.
2014-06-12 12:53:24,836 20117 INFO Hostname is being assigned as the domain name of this computer.
2014-06-12 12:53:24,836 20117 INFO HOSTNAME was not explicitly declared. Using hostname.domain.com
2014-06-12 12:53:24,836 20117 DEBUG Setting hostname to hostname.domain.com and servicename to memory usage
2014-06-12 12:53:24,836 20117 DEBUG Parsing command: /memory/virtual/percent --warning 80 --critical 90
2014-06-12 12:53:24,836 20117 DEBUG Command contained arguments.
2014-06-12 12:53:24,836 20117 DEBUG Command to be run: Nagios Hostname: hostname.domain.com -- Nagios Servicename: memory usage -- Command: /memory/virtual/percent -- Arguments: --warning 80 --critical 90 -- Stdout: None -- Return Code: None
2014-06-12 12:53:24,837 20117 DEBUG Parsing new individual command.
2014-06-12 12:53:24,837 20117 INFO Hostname is being assigned as the domain name of this computer.
2014-06-12 12:53:24,837 20117 INFO HOSTNAME was not explicitly declared. Using hostname.domain.com
2014-06-12 12:53:24,837 20117 DEBUG Setting hostname to hostname.domain.com and servicename to cpu usage
2014-06-12 12:53:24,837 20117 DEBUG Parsing command: /cpu/percent --warning 80 --critical 90
2014-06-12 12:53:24,837 20117 DEBUG Command contained arguments.
2014-06-12 12:53:24,837 20117 DEBUG Command to be run: Nagios Hostname: hostname.domain.com -- Nagios Servicename: cpu usage -- Command: /cpu/percent -- Arguments: --warning 80 --critical 90 -- Stdout: None -- Return Code: None
2014-06-12 12:53:24,838 20117 DEBUG Parsing new individual command.
2014-06-12 12:53:24,838 20117 INFO Hostname is being assigned as the domain name of this computer.
2014-06-12 12:53:24,838 20117 INFO HOSTNAME was not explicitly declared. Using hostname.domain.com
2014-06-12 12:53:24,838 20117 DEBUG Setting hostname to hostname.domain.com and servicename to swap usage
2014-06-12 12:53:24,838 20117 DEBUG Parsing command: /memory/swap/percent --warning 80 --critical 90
2014-06-12 12:53:24,838 20117 DEBUG Command contained arguments.
2014-06-12 12:53:24,839 20117 DEBUG Command to be run: Nagios Hostname: hostname.domain.com -- Nagios Servicename: swap usage -- Command: /memory/swap/percent -- Arguments: --warning 80 --critical 90 -- Stdout: None -- Return Code: None
2014-06-12 12:53:24,839 20117 DEBUG Establishing Nagios handler...
2014-06-12 12:53:24,839 20117 DEBUG Parsing arguments: --warning 80 --critical 90
2014-06-12 12:53:24,840 20117 DEBUG String args: ['./xxx', '--warning', '80', '--critical', '90']
2014-06-12 12:53:24,841 20117 DEBUG Accessing internal API with accessor /disk/logical/|/used_percent?warning=80&critical=90&unit=
2014-06-12 12:53:24,842 20117 DEBUG Accessor result!
2014-06-12 12:53:24,842 20117 DEBUG Accessing internal API with accessor disk/logical/|/used_percent
2014-06-12 12:53:24,842 20117 DEBUG Using 
2014-06-12 12:53:24,844 20117 DEBUG Reponse from server: {'returncode': 0, 'stdout': "OK: Used_percent was 9.1%|'used_percent_0'=9.1%;80;90"}
2014-06-12 12:53:24,844 20117 DEBUG Parsing arguments: --warning 80 --critical 90
2014-06-12 12:53:24,845 20117 DEBUG String args: ['./xxx', '--warning', '80', '--critical', '90']
2014-06-12 12:53:24,845 20117 DEBUG Accessing internal API with accessor /memory/virtual/percent?warning=80&critical=90&unit=
2014-06-12 12:53:24,845 20117 DEBUG Accessor result!
2014-06-12 12:53:24,845 20117 DEBUG Accessing internal API with accessor memory/virtual/percent
2014-06-12 12:53:24,845 20117 DEBUG Using 
2014-06-12 12:53:24,846 20117 DEBUG Reponse from server: {'returncode': 0, 'stdout': "OK: Percent was 72.0%|'percent_0'=72.0%;80;90"}
2014-06-12 12:53:24,847 20117 DEBUG Parsing arguments: --warning 80 --critical 90
2014-06-12 12:53:24,847 20117 DEBUG String args: ['./xxx', '--warning', '80', '--critical', '90']
2014-06-12 12:53:24,848 20117 DEBUG Accessing internal API with accessor /cpu/percent?warning=80&critical=90&unit=
2014-06-12 12:53:24,848 20117 DEBUG Accessor result!
2014-06-12 12:53:24,848 20117 DEBUG Accessing internal API with accessor cpu/percent
2014-06-12 12:53:24,848 20117 DEBUG Using 
2014-06-12 12:53:25,851 20117 DEBUG Reponse from server: {'returncode': 0, 'stdout': "OK: Percent was 2.0%|'percent_0'=2.0%;80;90"}
2014-06-12 12:53:25,851 20117 DEBUG Parsing arguments: --warning 80 --critical 90
2014-06-12 12:53:25,852 20117 DEBUG String args: ['./xxx', '--warning', '80', '--critical', '90']
2014-06-12 12:53:25,852 20117 DEBUG Accessing internal API with accessor /memory/swap/percent?warning=80&critical=90&unit=
2014-06-12 12:53:25,852 20117 DEBUG Accessor result!
2014-06-12 12:53:25,852 20117 DEBUG Accessing internal API with accessor memory/swap/percent
2014-06-12 12:53:25,853 20117 DEBUG Using 
2014-06-12 12:53:25,853 20117 DEBUG Reponse from server: {'returncode': 0, 'stdout': "OK: Percent was 0.0%|'percent_0'=0.0%;80;90"}
2014-06-12 12:53:25,902 20117 INFO Starting new HTTP connection (1): 10.1.3.169
2014-06-12 12:53:25,903 20117 DEBUG Setting read timeout to None
2014-06-12 12:53:25,907 20117 DEBUG "GET /nrdp/?token=eld9o6d20l79&cmd=submitcheck&XMLDATA=%3Ccheckresults%3E%0A%09%3Ccheckresult%3E%0A%09%09%3Cservicename%3E%0A%09%09%09disk-root-used-percent%0A%09%09%3C%2Fservicename%3E%0A%09%09%3Chostname%3E%0A%09%09%09hostname.domain.com%0A%09%09%3C%2Fhostname%3E%0A%09%09%3Cstate%3E%0A%09%09%090%0A%09%09%3C%2Fstate%3E%0A%09%09%3Coutput%3E%0A%09%09%09OK%3A+Used_percent+was+9.1%25%7C%27used_percent_0%27%3D9.1%25%3B80%3B90%0A%09%09%3C%2Foutput%3E%0A%09%3C%2Fcheckresult%3E%0A%09%3Ccheckresult%3E%0A%09%09%3Cservicename%3E%0A%09%09%09memory+usage%0A%09%09%3C%2Fservicename%3E%0A%09%09%3Chostname%3E%0A%09%09%09hostname.domain.com%0A%09%09%3C%2Fhostname%3E%0A%09%09%3Cstate%3E%0A%09%09%090%0A%09%09%3C%2Fstate%3E%0A%09%09%3Coutput%3E%0A%09%09%09OK%3A+Percent+was+72.0%25%7C%27percent_0%27%3D72.0%25%3B80%3B90%0A%09%09%3C%2Foutput%3E%0A%09%3C%2Fcheckresult%3E%0A%09%3Ccheckresult%3E%0A%09%09%3Cservicename%3E%0A%09%09%09cpu+usage%0A%09%09%3C%2Fservicename%3E%0A%09%09%3Chostname%3E%0A%09%09%09hostname.domain.com%0A%09%09%3C%2Fhostname%3E%0A%09%09%3Cstate%3E%0A%09%09%090%0A%09%09%3C%2Fstate%3E%0A%09%09%3Coutput%3E%0A%09%09%09OK%3A+Percent+was+2.0%25%7C%27percent_0%27%3D2.0%25%3B80%3B90%0A%09%09%3C%2Foutput%3E%0A%09%3C%2Fcheckresult%3E%0A%09%3Ccheckresult%3E%0A%09%09%3Cservicename%3E%0A%09%09%09swap+usage%0A%09%09%3C%2Fservicename%3E%0A%09%09%3Chostname%3E%0A%09%09%09hostname.domain.com%0A%09%09%3C%2Fhostname%3E%0A%09%09%3Cstate%3E%0A%09%09%090%0A%09%09%3C%2Fstate%3E%0A%09%09%3Coutput%3E%0A%09%09%09OK%3A+Percent+was+0.0%25%7C%27percent_0%27%3D0.0%25%3B80%3B90%0A%09%09%3C%2Foutput%3E%0A%09%3C%2Fcheckresult%3E%0A%3C%2Fcheckresults%3E%0A HTTP/1.1" 200 170
2014-06-12 12:53:25,908 20117 DEBUG hitting url with payload: http://10.1.3.169/nrdp/?token=eld9o6d20l79&cmd=submitcheck&XMLDATA=%3Ccheckresults%3E%0A%09%3Ccheckresult%3E%0A%09%09%3Cservicename%3E%0A%09%09%09disk-root-used-percent%0A%09%09%3C%2Fservicename%3E%0A%09%09%3Chostname%3E%0A%09%09%09hostname.domain.com%0A%09%09%3C%2Fhostname%3E%0A%09%09%3Cstate%3E%0A%09%09%090%0A%09%09%3C%2Fstate%3E%0A%09%09%3Coutput%3E%0A%09%09%09OK%3A+Used_percent+was+9.1%25%7C%27used_percent_0%27%3D9.1%25%3B80%3B90%0A%09%09%3C%2Foutput%3E%0A%09%3C%2Fcheckresult%3E%0A%09%3Ccheckresult%3E%0A%09%09%3Cservicename%3E%0A%09%09%09memory+usage%0A%09%09%3C%2Fservicename%3E%0A%09%09%3Chostname%3E%0A%09%09%09hostname.domain.com%0A%09%09%3C%2Fhostname%3E%0A%09%09%3Cstate%3E%0A%09%09%090%0A%09%09%3C%2Fstate%3E%0A%09%09%3Coutput%3E%0A%09%09%09OK%3A+Percent+was+72.0%25%7C%27percent_0%27%3D72.0%25%3B80%3B90%0A%09%09%3C%2Foutput%3E%0A%09%3C%2Fcheckresult%3E%0A%09%3Ccheckresult%3E%0A%09%09%3Cservicename%3E%0A%09%09%09cpu+usage%0A%09%09%3C%2Fservicename%3E%0A%09%09%3Chostname%3E%0A%09%09%09hostname.domain.com%0A%09%09%3C%2Fhostname%3E%0A%09%09%3Cstate%3E%0A%09%09%090%0A%09%09%3C%2Fstate%3E%0A%09%09%3Coutput%3E%0A%09%09%09OK%3A+Percent+was+2.0%25%7C%27percent_0%27%3D2.0%25%3B80%3B90%0A%09%09%3C%2Foutput%3E%0A%09%3C%2Fcheckresult%3E%0A%09%3Ccheckresult%3E%0A%09%09%3Cservicename%3E%0A%09%09%09swap+usage%0A%09%09%3C%2Fservicename%3E%0A%09%09%3Chostname%3E%0A%09%09%09hostname.domain.com%0A%09%09%3C%2Fhostname%3E%0A%09%09%3Cstate%3E%0A%09%09%090%0A%09%09%3C%2Fstate%3E%0A%09%09%3Coutput%3E%0A%09%09%09OK%3A+Percent+was+0.0%25%7C%27percent_0%27%3D0.0%25%3B80%3B90%0A%09%09%3C%2Foutput%3E%0A%09%3C%2Fcheckresult%3E%0A%3C%2Fcheckresults%3E%0A
2014-06-12 12:53:25,909 20117 DEBUG content response from payload: <?xml version="1.0" encoding="utf-8"?>
<result>
  <status>0</status>
  <message>OK</message>
    <meta>
       <output>4 checks processed.</output>
    </meta>
</result>

2014-06-12 12:53:25,929 20117 INFO Message from NRDP server: OK
2014-06-12 12:53:25,930 20117 INFO Meta output from NRDP server: 4 checks processed.
2014-06-12 12:53:25,930 20117 DEBUG Successfully ran handler nrdp

User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: ncpa passive checks not working

Post by lmiltchev »

Hm-m, you have "4 checks processed" in the log... Do you have anything in the Unconfigured Objects? Do other (not ncpa) passive checks work fine?

Go to: Admin->Performance Settings->Subsystem, and show us a screenshot of this page.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jcwuerfl
Posts: 76
Joined: Tue Jun 10, 2014 12:44 pm

Re: ncpa passive checks not working

Post by jcwuerfl »

Yes nothing in un-configured objects listed. It seems like other passive checks are working? Just not the disk-root-used-percent on specifically. seeing the "OK: No data received yet." on that one. I know the "disk root used percent" shows as critical .. I did remove that check but not sure why that one is still showing up.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: ncpa passive checks not working

Post by lmiltchev »

You don't have anything in Unconfigured Object as these checks are already configured. They seem to be working fine now, after the modifications you made with the exception of the disk check.

Do you see the correct value in the API?

Code: Select all

https://<ip address>:5693/api/disk/logical/|/used_percent
You need to see something like this:

Code: Select all

{
  "value": {
    "used_percent": [
      55.9, 
      "%"
    ]
  }
}
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked