Page 1 of 1
NCPA configuration "Cannot parse passive directive"
Posted: Mon Apr 20, 2015 12:53 pm
by mp4783
I am testing the NCPA 1.8.1 agent. The ncpa_passive.log is reporting the following:
2015-04-20 17:43:39,241 21148 ERROR Cannot parse passive directive for loglevel, name malformed, skipping.
2015-04-20 17:43:39,242 21148 ERROR Cannot parse passive directive for logmaxmb, name malformed, skipping.
2015-04-20 17:43:39,242 21148 ERROR Cannot parse passive directive for gid, name malformed, skipping.
2015-04-20 17:43:39,242 21148 ERROR Cannot parse passive directive for logbackups, name malformed, skipping.
2015-04-20 17:43:39,243 21148 ERROR Cannot parse passive directive for uid, name malformed, skipping.
My ncpa.cfg file contains non-default entries for uid and gid (i.e. they're not "nagios"). The other three have the following:
loglevel = info
logmaxmb = 50
logbackups = 1
I turned on debug level logging, but nothing more was printed.
Re: NCPA configuration "Cannot parse passive directive"
Posted: Mon Apr 20, 2015 4:17 pm
by lmiltchev
I was able to recreate the issue just by adding the following two lines to my ncpa.cfg file:
Other than that, I am using the "default" pid and gid. Here's what I see in the "/usr/local/ncpa/var/ncpa_passive.log":
Code: Select all
2015-04-20 16:10:18,294 10186 ERROR Cannot parse passive directive for logmaxmb, name malformed, skipping.
2015-04-20 16:10:18,295 10186 ERROR Cannot parse passive directive for gid, name malformed, skipping.
2015-04-20 16:10:18,295 10186 ERROR Cannot parse passive directive for logbackups, name malformed, skipping.
2015-04-20 16:10:18,296 10186 ERROR Cannot parse passive directive for uid, name malformed, skipping.
I will talk to our developers and will do some more testing and digging into this.
Re: NCPA configuration "Cannot parse passive directive"
Posted: Wed Nov 02, 2016 7:21 am
by mvndnburg
Did anything come out of your talk to the devs? I see the same errors in the log:
2016-11-02 13:20:10,453 4216 INFO Establishing passive handler: Handler
2016-11-02 13:20:10,453 4216 ERROR Cannot parse passive directive for loglevel, name malformed, skipping.
2016-11-02 13:20:10,453 4216 ERROR Cannot parse passive directive for logmaxmb, name malformed, skipping.
2016-11-02 13:20:10,453 4216 ERROR Cannot parse passive directive for gid, name malformed, skipping.
2016-11-02 13:20:10,453 4216 ERROR Cannot parse passive directive for logbackups, name malformed, skipping.
2016-11-02 13:20:10,454 4216 ERROR Cannot parse passive directive for uid, name malformed, skipping.
2016-11-02 13:20:10,454 4216 INFO Running check: /memory/swap/percent --warning 40 --critical 80
The
passive section in ncpa.cfg:
Code: Select all
[passive]
uid = nagios
handlers = nrds,nrdp
loglevel = info
gid = nagcmd
sleep = 180
logfile = var/ncpa_passive.log
logmaxmb = 10
logbackups = 5
pidfile = var/ncpa_passive.pid
ncpa-1.8.1 on RHEL 6.8.
Re: NCPA configuration "Cannot parse passive directive"
Posted: Wed Nov 02, 2016 8:53 am
by jomann
Please post your entire ncpa.cfg file (you can remove passwords and whatnot)
Re: NCPA configuration "Cannot parse passive directive"
Posted: Wed Nov 02, 2016 9:47 am
by mvndnburg
Code: Select all
[listener]
uid = nagios
certificate = adhoc
loglevel = info
ip = 0.0.0.0
gid = nagcmd
logfile = var/ncpa_listener.log
logmaxmb = 10
logbackups = 5
port = 5693
pidfile = var/ncpa_listener.pid
# Available versions: PROTOCOL SSLv2, SSLv3, TLSv1
ssl_version = TLSv1
[passive]
uid = nagios
handlers = nrds,nrdp
loglevel = info
gid = nagcmd
sleep = 180
logfile = var/ncpa_passive.log
logmaxmb = 10
logbackups = 5
pidfile = var/ncpa_passive.pid
[nrdp]
token = <deleted>
parent = http://10.132.164.201/nrdp
[nrds]
URL = <deleted>
CONFIG_VERSION = 0.2
TOKEN =<deleted>
CONFIG_NAME = default01
CONFIG_OS = Linux
UPDATE_CONFIG = 1
UPDATE_PLUGINS = 1
[api]
community_string = <deleted>
[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 70 --critical 90
#%HOSTNAME%|swap usage = /memory/swap/percent --warning 40 --critical 80
#%HOSTNAME%|memory usage = /memory/virtual/percent --warning 60 --critical 80
#%HOSTNAME%|sssd service = /service/sssd --warning 1 --critical 0
#%HOSTNAME%|sshd service = /service/sshd --warning 1 --critical 0
Re: NCPA configuration "Cannot parse passive directive"
Posted: Wed Nov 02, 2016 4:50 pm
by ssax
I believe this is a bug, they can safely be ignored.
What I think is happening is that it tries to parse the config file and looks for "passive checks", I think the space is breaking it and causing it to only search for "passive" which would include the section you are getting errors about as well as the others.
Re: NCPA configuration "Cannot parse passive directive"
Posted: Thu Nov 03, 2016 1:53 am
by mvndnburg
Thank you for checking

Re: NCPA configuration "Cannot parse passive directive"
Posted: Thu Nov 03, 2016 3:36 pm
by mcapra
Sure thing! Did you have additional questions regarding this or notice any sort of instability with NCPA itself?
If not, is it alright if we close this thread and mark the issue as resolved?
Re: NCPA configuration "Cannot parse passive directive"
Posted: Fri Nov 04, 2016 1:35 am
by mvndnburg
I have no further question regarding the NCPA at this moment.
Please go ahead and close the thread.
Re: NCPA configuration "Cannot parse passive directive"
Posted: Fri Nov 04, 2016 9:28 am
by dwhitfield
Glad to hear it is resolved. I am going to lock the thread. Please feel free to post again if you have you another issue. Thank you for using the Nagios forums!