Page 1 of 1
ncpa.cfg - passive check
Posted: Tue Oct 13, 2015 10:57 am
by jcwuerfl
I had a passive check in ncpa.cfg that was:
%HOSTNAME%|root free = /disk/logical/|/used_percent --warning 90 --critical 95
but I changed the name of it to:
%HOSTNAME%|disk_root_used = /disk/logical/|/used_percent --warning 90 --critical 95
Saved/Restarted the ncpa_passive service. However, the root free passive check keeps showing up in unconfigured objects?? Was there something else I need to do ?
Thanks!
Re: ncpa.cfg - passive check
Posted: Tue Oct 13, 2015 4:20 pm
by lmiltchev
How often passive checks are sent? Can you show us a sanitized version of the npcd.cfg?
Re: ncpa.cfg - passive check
Posted: Wed Oct 14, 2015 7:18 am
by jcwuerfl
Sure, this is what I have currently.
sleep = 10
Maybe that's a bit aggressive but I was testing.
Code: Select all
[listener]
uid = nagios
gid = nagcmd
ip = 0.0.0.0
port = 5693
certificate = adhoc
ssl_version = TLSv1
loglevel = ERROR
logmaxmb = 10
logbackups = 10
logfile = var/ncpa_listener.log
pidfile = var/ncpa_listener.pid
[passive]
uid = nagios
gid = nagcmd
handlers = nrdp
sleep = 10
loglevel = ERROR
logmaxmb = 10
logbackups = 10
logfile = var/ncpa_passive.log
pidfile = var/ncpa_passive.pid
[nrdp]
token = mytoken
parent = http://nagiosxi.mydomain.local/nrdp/
hostname = myhost.mydomain.com
[api]
community_string = mycommunitystring
[plugin directives]
plugin_path = plugins/
.sh = /bin/sh $plugin_name $plugin_args
.ps1 = powershell -ExecutionPolicy Bypass -File $plugin_name $plugin_args
.vbs = cscript $plugin_name $plugin_args //NoLogo
[passive checks]
#%HOSTNAME%|cpu_usage = /cpu/percent --warning 90 --critical 95
%HOSTNAME%|swap_usage = /memory/swap/percent --warning 50 --critical 80
%HOSTNAME%|memory_usage = /memory/virtual/percent --warning 80 --critical 90
%HOSTNAME%|disk_boot_used = /disk/logical/|boot/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_root_used = /disk/logical/|/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_opt_used = /disk/logical/|opt/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_var_used = /disk/logical/|var/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_varLog_used = /disk/logical/|var|log/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_varLogAudit_used = /disk/logical/|var|log|audit/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_home_used = /disk/logical/|home/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_usr_used = /disk/logical/|usr/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_tmp_used = /disk/logical/|tmp/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_pkg_used = /disk/logical/|pkg/used_percent --warning 90 --critical 95
#%HOSTNAME%|disk_data_used = /disk/logical/|data/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_dbdata_used = /disk/logical/|dbdata/used_percent --warning 90 --critical 95
%HOSTNAME%|disk_dbarch_used = /disk/logical/|dbarch/used_percent --warning 90 --critical 95
#%HOSTNAME%|val_oracle_db = /services?service=val_oracle_db&status=running&check=true
Re: ncpa.cfg - passive check
Posted: Wed Oct 14, 2015 4:31 pm
by lmiltchev
The passive checks seem to be defined properly. I was not able to recreate the issue in house. Can you post the "ncpa_passive.log" as well? I hope we can find some clues in the log, that will point us to the right direction. Does the "old" check show up under "Unconfigured" objects after you clear them in XI?
Re: ncpa.cfg - passive check
Posted: Wed Oct 14, 2015 5:03 pm
by jcwuerfl
Sure I can post the log tomorrow. Yes the old check continues to show in unconfigured objects. So assuming it's somehow cached on the host side still somehow? The process was not running I made sure to stop everthing and check for any other running processes.
Re: ncpa.cfg - passive check
Posted: Thu Oct 15, 2015 9:16 am
by jcwuerfl
If I comment all the passive checks out I get this error:
2015-10-15 09:07:33,381 32750 ERROR syntax error: line 1, column 0
Traceback (most recent call last):
File "ncpa_posix_passive.py", line 41, in run_all_handlers
File "/root/Development/ncpa/agent/passive/nrdp.py", line 112, in run
File "/root/Development/ncpa/agent/passive/nrdp.py", line 166, in submit_to_nagios
File "/root/Development/ncpa/agent/passive/nrdp.py", line 132, in log_result
File "/usr/local/lib/python2.7/xml/dom/minidom.py", line 1928, in parseString
File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
File "/usr/local/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
ExpatError: syntax error: line 1, column 0
I cleared out all of my unconfigured objects. Only set this passive check:
%HOSTNAME%|disk_root_used = /disk/logical/|/used_percent --warning 90 --critical 95
Looks like I'm now only seeing the disk_root_used check show up now which is good. Not sure what was going on before. However, see error above for when no checks are enabled? Perhaps if there is no checks then the service should just be disabled. However, I think this could be a bit more graceful, just say: no passive checks defined in the output?
Re: ncpa.cfg - passive check
Posted: Thu Oct 15, 2015 1:51 pm
by tmcdonald
That's probably the right way to handle having no passives defined, I'll see what the devs can do.
However, are you able to get this working how you'd like? It sounds as if you can only get this passive check to work if it is the only one there, so I don't want to close out this thread until you give the okay.
Re: ncpa.cfg - passive check
Posted: Thu Oct 15, 2015 1:56 pm
by jcwuerfl
I agree better to disable the service, however if it is enabled, and its enabled by default when installing. I think the output in the error log should be a bit more graceful. So thanks for checking to see what the dev's can do with that.
I'd like to leave it open for it bit to see if I re-encounter another one of those checks still being there in un-configured objects again after I remove it. So if I haven't in the next week I would say its OK to close.
Thanks again!
Re: ncpa.cfg - passive check
Posted: Thu Oct 15, 2015 3:41 pm
by tgriep
We'll leave the post open then.