Errors trying to set up passive checks using NCPA and NRDP

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
meganwilliford
Posts: 101
Joined: Tue Aug 06, 2019 7:49 am

Errors trying to set up passive checks using NCPA and NRDP

Post by meganwilliford »

I'm working on configuring passive checks using Nagios XI and NRDP. NRDP seems to be working okay because I'm able using the NRDP API and receive unconfigured objects from it. However, on a remote windows server with NCPA installed, I'm getting errors in the ncpa_passive.log. I've included a snippet of the errors, the ncpa.cfg passive configuration, and the passive checks. Any idea how to resolve the errors and successfully receive unconfigured objects in our Nagios XI system?

Here is an example of the errors:

2024-02-08 08:27:47,888:ERROR:nrdp:mismatched tag: line 20, column 2
Traceback (most recent call last):
File "C:\ncpa\agent\passive\nrdp.py", line 199, in submit_to_nagios
File "C:\ncpa\agent\passive\nrdp.py", line 145, in log_result
File "C:\Python27\lib\xml\dom\minidom.py", line 1928, in parseString
File "C:\Python27\lib\xml\dom\expatbuilder.py", line 940, in parseString
File "C:\Python27\lib\xml\dom\expatbuilder.py", line 223, in parseString
ExpatError: mismatched tag: line 20, column 2
2024-02-08 08:32:48,030:ERROR:nrdp:mismatched tag: line 20, column 2
Traceback (most recent call last):
File "C:\ncpa\agent\passive\nrdp.py", line 199, in submit_to_nagios
File "C:\ncpa\agent\passive\nrdp.py", line 145, in log_result
File "C:\Python27\lib\xml\dom\minidom.py", line 1928, in parseString
File "C:\Python27\lib\xml\dom\expatbuilder.py", line 940, in parseString
File "C:\Python27\lib\xml\dom\expatbuilder.py", line 223, in parseString
ExpatError: mismatched tag: line 20, column 2


___________________________________________________________________________________

The passive configuration in the ncpa.cfg looks like this:

# -------------------------------
# Passive Configuration (daemon)
# -------------------------------
#

[passive]

#
# Handlers are a comma separated list of what you would like the passive agent to run
# Default: None
# Options:
# nrdp, kafkaproducer
#
# Example:
# handlers = nrdp,kafkaproducer
#
handlers=nrdp

#
# User and group to run passive checks as (Recommended to use nagios:nagios)
# Default: uid = nagios
# Default: gid = nagios
#
# This is for Unix only (Linux, Mac OS X, etc)
#
uid=nagios
gid=nagios

#
# Passive check interval - the amount in seconds to wait between each passive check by default,
# this can be overwritten by adding on a "|<duration>" in seconds to the passive check config
# Default: 300 (5 minutes)
#
sleep =300

#
# Passive logging file level, location, and the PID location
# Default: loglevel = info (debug, info, warning, error)
# Default: logfile = var/log/ncpa_passive.log
# Default: pidfile = var/run/ncpa_passive.pid (leave passive in pid file name)
#
loglevel =warning
logfile = var/log/ncpa_passive.log
pidfile = var/run/ncpa_passive.pid

#
# Delay passive checks from starting in seconds
# Default: 0
#
# delay_start = 30

#
# The max size allowed for a log file in megabytes.
# When the log becomes larger than this, the log will be rolled over
# and a new log will be started.
# Default: 5
#
# logmaxmb =

#
# The max number of log rollovers that will be kept.
# Default: 5
#
# logbackups =

#
# -------------------------------
# Passive Configuration (NRDP)
# -------------------------------
#

[nrdp]

#
# Connection settings to the NRDP server
# parent = NRDP server location (ex: http://<address>/nrdp)
# token = NRDP server token used to send NRDP results
#
parent=https://<redacted>/nrdp/
token=<tokenredacted>

#
# The hostname that will replace %HOSTNAME% in the check definitions and will be
# sent to NRDP with the check name as the service description (service name)
#
hostname=<hostnameredacted>

______________________________________________________________________

The passive checks in /ncpa.cfg.d/nrdp.cfg are configured like this:

#
# Basic example of Passive checks being defined
#

[passive checks]

%HOSTNAME%|__HOST__ = system/agent_version
%HOSTNAME%|Disk Usage on C/ = /disk/logical/C:|/used_percent --warning 80 --critical 90 --units Gi
%HOSTNAME%|Disk Usage on F/ = /disk/logical/F:|/used_percent --warning 80 --critical 90 --units Gi
%HOSTNAME%|CPU Usage = cpu/percent --warning 60 --critical 80 --aggregate avg
%HOSTNAME%|Swap Usage = memory/swap --warning 60 --critical 80 --units Gi
%HOSTNAME%|Memory Usage = memory/virtual --warning 80 --critical 90 --units Gi
%HOSTNAME%|Process Count = processes --warning 300 --critical 400
User avatar
swolf
Developer
Posts: 302
Joined: Tue Jun 06, 2017 9:48 am

Re: Errors trying to set up passive checks using NCPA and NRDP

Post by swolf »

Hi @meganwilliford, thanks for reaching out.

For the errors you're seeing, I would say that you ran into a bug. The first thing I'm going to recommend is that you upgrade to NCPA 3 if possible, and see if that fixes your error.

If that doesn't fix your problems, I've submitted an issue on the NCPA GitHub. If you can post an updated log with the new errors, we'll look to fix that (or at least get you a more helpful error) for the next maintenance release.
-Sebastian
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
Post Reply