Page 1 of 1

NCPA - error - Unable to run check on non-child node

Posted: Thu Jan 14, 2016 7:21 am
by comfone
Hi All
I'm trying to run the plugin "check_windows_updates.ps1" using NCPA in passiv mode.
After having configured everything and restarted the NCPA services on the Windows Server, I get the correct message over NRDP to our Nagios XI Server.
But after 5 minutes the passive service on the Nagiox XI reports "Unknown" with the "Status Information" Unable to run check on non-child node. Revise your query.
Further below my ncpa.cfg file.
Why does it after a manual restart of the NCPA services work, but after the scheduled "sleep of 300" gives me an error?

[listener]
uid = nagios
certificate = adhoc
loglevel = info
ip = 0.0.0.0
gid = nagcmd
logfile = var/ncpa_listener.log
port = 5693
pidfile = var/ncpa_listener.pid
# Available versions: PROTOCOL SSLv2, SSLv3, TLSv1
ssl_version = TLSv1

[passive]
uid = nagios
handlers = nrdp
loglevel = info
gid = nagcmd
sleep = 300
logfile = var/ncpa_passive.log
pidfile = var/ncpa_passive.pid

[nrdp]
token =******
hostname =csvit111
parent =http://10.20.98.21/nrdp/

[nrds]
URL =None
CONFIG_VERSION = None
TOKEN = None
CONFIG_NAME = None
CONFIG_OS = None
PLUGIN_DIR=plugins/
UPDATE_CONFIG=0
UPDATE_PLUGINS=1

[api]
community_string =****

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

[passive checks]
%HOSTNAME%|WinUpdates = /agent/plugin/check_windows_updates.ps1
#%HOSTNAME%|cpu usage = /cpu/percent --warning 20 --critical 30
#%HOSTNAME%|swap usage = /memory/swap/percent --warning 40 --critical 80
#%HOSTNAME%|memory usage = /memory/virtual/percent --warning 60 --critical 80

Re: NCPA - error - Unable to run check on non-child node

Posted: Thu Jan 14, 2016 11:19 am
by rkennedy
Can you confirm what version of NCPA you are running?

I believe this may be related to an earlier bug here, https://github.com/NagiosEnterprises/ncpa/issues/95.

Re: NCPA - error - Unable to run check on non-child node

Posted: Thu Jan 14, 2016 2:31 pm
by comfone
We are running Nagios XI 5.2.3 and NPCA 1.8.1.

Re: NCPA - error - Unable to run check on non-child node

Posted: Thu Jan 14, 2016 5:08 pm
by lmiltchev
Change this:

Code: Select all

%HOSTNAME%|WinUpdates = /agent/plugin/check_windows_updates.ps1
to this:

Code: Select all

%HOSTNAME%|WinUpdates = agent/plugin/check_windows_updates.ps1
(remove the "/" before "agent").

Restart the NCPA Passive service and see if the output will change next time the check is run.

Re: NCPA - error - Unable to run check on non-child node

Posted: Fri Jan 15, 2016 4:17 am
by comfone
s you can see below, I removed the "/" before "agent" but my problem still persists.


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

[passive checks]
%HOSTNAME%|WinUpdates = agent/plugin/check_windows_updates.ps1
#%HOSTNAME%|cpu usage = /cpu/percent --warning 20 --critical 30
#%HOSTNAME%|swap usage = /memory/swap/percent --warning 40 --critical 80
#%HOSTNAME%|memory usage = /memory/virtual/percent --warning 60 --critical 80

Any other suggestion?

Re: NCPA - error - Unable to run check on non-child node

Posted: Fri Jan 15, 2016 1:20 pm
by lmiltchev
I believe I misled you about the "/". :(
It worked for me (temporarily) only because I restarted the NCPA Passive service. It seems like this is a bug. The check works on the first run, then it fails with the "Unable to run check on non-child node. Revise your query." error.

First run:
example01.PNG
Any of the following runs:
example02.PNG
FYI, I added a comment here:

https://github.com/NagiosEnterprises/ncpa/issues/97

Our developers will be looking into this as soon as they can. Thanks!

Re: NCPA - error - Unable to run check on non-child node

Posted: Sat Jan 16, 2016 4:36 am
by comfone
Hi lmiltchev
Thank you for the feedback.
Looking forward for the fix ;)
Cheers,

Re: NCPA - error - Unable to run check on non-child node

Posted: Mon Jan 18, 2016 10:58 am
by lmiltchev
You are welcome! I will be locking this topic now. If you have any other questions/issues, start a new thread. If you need this topic to be re-opened, PM me. Thank you!