NCPA configuration "Cannot parse passive directive"

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mp4783
Posts: 116
Joined: Wed May 14, 2014 11:11 am

NCPA configuration "Cannot parse passive directive"

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA configuration "Cannot parse passive directive"

Post by lmiltchev »

I was able to recreate the issue just by adding the following two lines to my ncpa.cfg file:

Code: Select all

logmaxmb = 50
logbackups = 1
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
mvndnburg
Posts: 64
Joined: Wed Sep 21, 2016 2:53 am

Re: NCPA configuration "Cannot parse passive directive"

Post 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.
--
Martijn
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: NCPA configuration "Cannot parse passive directive"

Post by jomann »

Please post your entire ncpa.cfg file (you can remove passwords and whatnot)
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mvndnburg
Posts: 64
Joined: Wed Sep 21, 2016 2:53 am

Re: NCPA configuration "Cannot parse passive directive"

Post 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
--
Martijn
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NCPA configuration "Cannot parse passive directive"

Post 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.
mvndnburg
Posts: 64
Joined: Wed Sep 21, 2016 2:53 am

Re: NCPA configuration "Cannot parse passive directive"

Post by mvndnburg »

Thank you for checking :)
--
Martijn
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: NCPA configuration "Cannot parse passive directive"

Post 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?
Former Nagios employee
https://www.mcapra.com/
mvndnburg
Posts: 64
Joined: Wed Sep 21, 2016 2:53 am

Re: NCPA configuration "Cannot parse passive directive"

Post by mvndnburg »

I have no further question regarding the NCPA at this moment.
Please go ahead and close the thread.
--
Martijn
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: NCPA configuration "Cannot parse passive directive"

Post 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!
Locked