NCPA Agent log errors

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jwuerflein
Posts: 6
Joined: Wed Apr 29, 2015 2:02 pm

NCPA Agent log errors

Post by jwuerflein »

Any ideas why I may be seeing these errors in my passive.log file ?

Code: Select all

2015-04-29 14:43:39,108 11400 INFO Establishing passive handler: Handler
2015-04-29 14:43:39,108 11400 ERROR Cannot parse passive directive for loglevel, name malformed, skipping.
2015-04-29 14:43:39,109 11400 ERROR Cannot parse passive directive for logmaxmb, name malformed, skipping.
2015-04-29 14:43:39,109 11400 ERROR Cannot parse passive directive for gid, name malformed, skipping.
2015-04-29 14:43:39,110 11400 ERROR Cannot parse passive directive for logbackups, name malformed, skipping.
2015-04-29 14:43:39,110 11400 ERROR Cannot parse passive directive for uid, name malformed, skipping.
2015-04-29 14:43:39,111 11400 INFO Running check: /disk/logical/|/free --warning 90 --critical 95
2015-04-29 14:43:39,119 11400 INFO Starting new HTTP connection (1): nagiosxi.domain.local
2015-04-29 14:43:39,127 11400 ERROR mismatched tag: line 11, column 2
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: mismatched tag: line 11, column 2
Last edited by jwuerflein on Fri May 01, 2015 7:07 am, edited 2 times in total.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA Agent log errors

Post by lmiltchev »

/disk/logical/|/free --warning 90 --critical 95
This doesn't seem correct. You should have something like this:

Code: Select all

disk/logical/C:|/free --warning 90 --critical 95
or

Code: Select all

disk/logical/D:|/free --warning 90 --critical 95
Note: The drive letter is missing in your command...

Can you show us how the passive checks are defined?
Be sure to check out our Knowledgebase for helpful articles and solutions!
jwuerflein
Posts: 6
Joined: Wed Apr 29, 2015 2:02 pm

Re: NCPA Agent log errors

Post by jwuerflein »

This is a red hat server.

Code: Select all

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

[passive]
uid = nagios
gid = nagcmd
handlers = nrdp
loglevel = info
logmaxmb = 20
logbackups = 10
sleep=30
logfile = var/ncpa_passive.log
pidfile = var/ncpa_passive.pid

[nrdp]
token = token
hostname = host.domain.local
parent = http://nagiosxi.domain.local/

[nrds]
URL = None
CONFIG_VERSION = None
TOKEN = None
CONFIG_NAME = None
CONFIG_OS = None

[api]
community_string = string

[plugin directives]
plugin_path = plugins/
.sh = /bin/sh $plugin_name $plugin_args

[passive checks]
%HOSTNAME%|root free = /disk/logical/|/free --warning 90 --critical 95
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NCPA Agent log errors

Post by tgriep »

Try removing the following from the ncpa.cfg file and restart the passive service and let us know if the errors are gone.

Code: Select all

logmaxmb = 20
logbackups = 10
Be sure to check out our Knowledgebase for helpful articles and solutions!
jwuerflein
Posts: 6
Joined: Wed Apr 29, 2015 2:02 pm

Re: NCPA Agent log errors

Post by jwuerflein »

No same.

Code: Select all

2015-05-01 07:05:55,191 28443 INFO Establishing passive handler: Handler
2015-05-01 07:05:55,193 28443 ERROR Cannot parse passive directive for loglevel, name malformed, skipping.
2015-05-01 07:05:55,193 28443 ERROR Cannot parse passive directive for logmaxmb, name malformed, skipping.
2015-05-01 07:05:55,193 28443 ERROR Cannot parse passive directive for gid, name malformed, skipping.
2015-05-01 07:05:55,194 28443 ERROR Cannot parse passive directive for logbackups, name malformed, skipping.
2015-05-01 07:05:55,194 28443 ERROR Cannot parse passive directive for uid, name malformed, skipping.
2015-05-01 07:05:55,195 28443 INFO Running check: /disk/logical/|/free --warning 90 --critical 95
2015-05-01 07:05:55,207 28443 INFO Starting new HTTP connection (1): nagiosxi.domain.local
2015-05-01 07:05:55,214 28443 ERROR mismatched tag: line 11, column 2
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: mismatched tag: line 11, column 2
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NCPA Agent log errors

Post by tgriep »

Is the disk check working for you?

I will have to talk to the developers about the error messages.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jwuerflein
Posts: 6
Joined: Wed Apr 29, 2015 2:02 pm

Re: NCPA Agent log errors

Post by jwuerflein »

Unfortunately no, it doesn't seem to update the status.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NCPA Agent log errors

Post by ssax »

In this section here:

Code: Select all

[nrdp]
token = token
hostname = host.domain.local
parent = http://nagiosxi.domain.local/
In XI, go to Admin > Check Transfers > Inbound Transfers.

Then click on the NRDP tab and change your token and then click update settings.

Copy the token and the NRDP link from that page and put them in your ncpa.cfg and restart ncpa_listener and ncpa_passive.

Code: Select all

[nrdp]
token = mynewtoken
hostname = host.domain.local
parent = http://nagiosxi.domain.local/nrdp/
Let us know if that works for you.
jwuerflein
Posts: 6
Joined: Wed Apr 29, 2015 2:02 pm

Re: NCPA Agent log errors

Post by jwuerflein »

I was missing the /nrpd/ which I added and that allowed me to get a little bit farther. Still a couple errors though.

Code: Select all

2015-05-01 10:00:32,547 3371 INFO Establishing passive handler: Handler
2015-05-01 10:00:32,548 3371 ERROR Cannot parse passive directive for loglevel, name malformed, skipping.
2015-05-01 10:00:32,549 3371 ERROR Cannot parse passive directive for logmaxmb, name malformed, skipping.
2015-05-01 10:00:32,549 3371 ERROR Cannot parse passive directive for gid, name malformed, skipping.
2015-05-01 10:00:32,549 3371 ERROR Cannot parse passive directive for logbackups, name malformed, skipping.
2015-05-01 10:00:32,550 3371 ERROR Cannot parse passive directive for uid, name malformed, skipping.

2015-05-01 10:00:32,551 3371 INFO Running check: /cpu/percent --warning 20 --critical 30
2015-05-01 10:00:33,559 3371 INFO Running check: /memory/swap/percent --warning 40 --critical 80
2015-05-01 10:00:33,564 3371 INFO Running check: /memory/virtual/percent --warning 60 --critical 80
2015-05-01 10:00:33,568 3371 INFO Running check: /disk/logical/|/free --warning 90 --critical 95
2015-05-01 10:00:33,576 3371 INFO Starting new HTTP connection (1): nagiosxi.domain.local
2015-05-01 10:00:33,590 3371 INFO Message from NRDP server: OK
2015-05-01 10:00:33,591 3371 INFO Meta output from NRDP server: 4 checks processed.
The checks are updating and alerting now.

The check I had before wasn't quite right, so I changed it to this which looks like it works:

%HOSTNAME%|root free = /disk/logical/|/used_percent --warning 90 --critical 95



Not sure why I'm getting the above errors? Here is the current config then:

Code: Select all

[listener]
uid = nagios
guid = nagcmd
ip = 0.0.0.0
port = 5693
certificate = adhoc
ssl_version = TLSv1
loglevel = info
logmaxmb = 10
logbackups = 10
logfile = var/ncpa_listener.log
pidfile = var/ncpa_listener.pid

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

[nrdp]
token = token
parent = http://nagiosxi.domain.local/nrdp/
hostname = hostname.domain.local

[api]
community_string = string

[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%|root free = /disk/logical/|/used_percent --warning 90 --critical 95
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NCPA Agent log errors

Post by ssax »

I'm getting those same errors in mine, looks like a bug in NCPA, it still works though.
Locked