NCPA: NRDP connect returns "NO TOKENS" result

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
inversecow
Posts: 44
Joined: Wed Sep 25, 2019 4:17 pm

NCPA: NRDP connect returns "NO TOKENS" result

Post by inversecow »

Ahoy folks,

I have a RHEL6 node with NCPA installed and appears to be configured correctly (including a valid token).
I am attempting to leverage "passive checks" using rules defined within the NCPA config structure (EG: /usr/local/ncpa/etc/ncpa.cfg.d/nrdp.cfg).

While I see the NCPA appears to recognize / process my rules just fine, my nodes never seem to get any data through to the XI (via NRDP).
In tailing the logs on the monitored node, I see a "NO TOKENS" result passed back from NRDP.

I also get this when I try to use the XI NRDP interface directly (via a browser).

The monitored node exists as a host record on XI, and I have successful "active checks" (EG: PING) working just fine.
Also, nothing is showing up in the "XI: ADMIN > Unconfigured Objects" interface, which I understand is where I would perform the next step of work.

I am most keen to figure this out, as at present it would appear my ORG (who is on-boarding Nagios) is unable to make use of passive checks.

Is this something that has manifest before?
If so, how might I proceed to fix the matter?

Happy to collect further information as needed to support any efforts to figure this out.

# monitored node
OS: Red Hat Enterprise Linux Server release 6.10 (Santiago) (monitored node)
BITS: 64
NCPA: 2.1.6-1

# application node
OS: Red Hat Enterprise Linux Server release 7.7 (Maipo)
BITS: 64
XI: 5.6.6
Install type: Manual install
SSL: enabled (https://assets.nagios.com/downloads/nag ... s%20XI.pdf)
NOTE: XI is behind a software defined load-balancer (VMWare level as I recall), LB has the same SSL cert as what is setup in XI.

# /usr/local/ncpa/etc/ncpa.cfg.d/nrdp.cfg

Code: Select all

[passive checks]

%HOSTNAME%|__HOST__ = system/agent_version
#%HOSTNAME%|Disk Usage = disk/logical/C:|/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%|NCPA Passive Service Check = services?service=ncpa_passive&status=running&check=1
%HOSTNAME%|/opt Percentage Utilization = disk/logical/|opt/used_percent --warning 90 --critical 95
#%HOSTNAME%|Memory Usage = memory/virtual --warning 80 --critical 90 --units Gi
#%HOSTNAME%|Process Count = processes --warning 300 --critical 400
# /usr/local/ncpa/var/log/ncpa_passive.log

Code: Select all

2019-11-07 23:58:46,552 19711 DEBUG Starting new HTTPS connection (1): nagios.domain.tld
2019-11-07 23:58:46,634 19711 DEBUG https://nagios.domain.tld:443 "POST /nrdp/ HTTP/1.1" 200 115
2019-11-07 23:58:46,636 19711 DEBUG Content response from URL: <?xml version="1.0" encoding="utf-8"?>
<result>
    <status>-1</status>
    <message>NO TOKENS</message>
</result>

2019-11-07 23:58:46,636 19711 WARNING XML returned did not contain a message, or was malformed.
2019-11-07 23:58:46,637 19711 INFO Message from NRDP server: NO TOKENS
2019-11-07 23:58:46,637 19711 INFO Meta output from NRDP server: Nonexistent
“And who better understands the Unix-nature?” Master Foo asked.
“Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”
Master Foo - The ten thousand Lines
Unix Koans of Master Foo
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA: NRDP connect returns "NO TOKENS" result

Post by lmiltchev »

First, try stopping/starting ncpa_passive service:

Code: Select all

service ncpa_passive stop
service ncpa_passive start
Check the status to make sure the service is running:

Code: Select all

service ncpa_passive status
Next, look into the /usr/local/ncpa/var/log/ncpa_passive.log again to see if there are any clues.

Also, post the entire ncpa.cfg file on the forum.

Is there a reason why you are not using the latest agent? NCPA that you are running on the remote machine is like 5 versions behind...
Be sure to check out our Knowledgebase for helpful articles and solutions!
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: NCPA: NRDP connect returns "NO TOKENS" result

Post by benjaminsmith »

Hello @inversecow,

Just following up on this post as it has been a while since we last heard from you. Were you able to get your issue resolved? Let us know when you have a moment.

Thanks!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
inversecow
Posts: 44
Joined: Wed Sep 25, 2019 4:17 pm

Re: NCPA: NRDP connect returns "NO TOKENS" result

Post by inversecow »

Ahoy folks,

Apologies for the delay in responding, coming back with a positive update after remembering I still had this open post.
In the end, the issue was on the XI node itself.

Specifically I have included some references below.
Not sure if this is captured in the docs (if so, my bad), but if it is not present, I would suggest this should be added.
This also got "flattened" when I performed an XI upgrade recently, and I had to re-add my tokens once again.

# BEFORE

Code: Select all

[13:44:02:user@xi_node:~]
$ grep 'authorized_tokens' /usr/local/nrdp/server/config.inc.php
$cfg['authorized_tokens'] = array();
# AFTER

Code: Select all

[13:45:02:user@xi_node:~]
$ grep 'authorized_tokens' /usr/local/nrdp/server/config.inc.php
$cfg['authorized_tokens'] = array("Token_here", "another_token_here", "yet_another_token");
Thanks all for your help!
This issue is now resolved.

Do let me know should further questions occur.
“And who better understands the Unix-nature?” Master Foo asked.
“Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”
Master Foo - The ten thousand Lines
Unix Koans of Master Foo
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: NCPA: NRDP connect returns "NO TOKENS" result

Post by benjaminsmith »

Hi,
Thanks all for your help!
This issue is now resolved.
Good to hear and thanks for summarizing the issue for us. What version were you upgrading from ( on XI)?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
inversecow
Posts: 44
Joined: Wed Sep 25, 2019 4:17 pm

Re: NCPA: NRDP connect returns "NO TOKENS" result

Post by inversecow »

Hello!

We layered at XI 5.6.6 (not sure what CORE version comes with that).
We upgraded to XI 5.6.8 this morning, and had to re-enter our tokens (which were still present within the XI GUI layer).

Again, not sure if its captured in the docs somewhere that one must not only create tokens in XI GUI, but also update the indicated file also.
I had the (possibly inaccurate) expectation that the XI GUI would update this file once a token had been entered (and the update button clicked).

This is what lead to the confusion as I see it, as once I manually updated the file, everything "just worked" (without any service restarts required).
“And who better understands the Unix-nature?” Master Foo asked.
“Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”
Master Foo - The ten thousand Lines
Unix Koans of Master Foo
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NCPA: NRDP connect returns "NO TOKENS" result

Post by ssax »

NRDP must've been upgraded and it replaced the config file /usr/local/nrdp/server/config.inc.php.

Do you see any .rpmnew or .rpmsave files in the /usr/local/nrdp/server directory?

Code: Select all

ls -lh /usr/local/nrdp/server
What is the output of these commands:

Code: Select all

rpm -qa | grep -i nrdp
rpm -qa | grep nagiosxi
I've reached out to the devs on this to find out why that occurred, they said it should not do that because of this code:

Code: Select all

# Copy old config
cp -f "$installdir/server/config.inc.php" "/tmp/config.inc.php"
# Copy files
cd "$pkgname"
cp -rf server clients LICENSE* /usr/local/nrdp
cd ..
# Overwrite the copied config
cp -f "/tmp/config.inc.php" "$installdir/server/config.inc.php"
I'm thinking this could be because of you installing via RPM or something.
User avatar
inversecow
Posts: 44
Joined: Wed Sep 25, 2019 4:17 pm

Re: NCPA: NRDP connect returns "NO TOKENS" result

Post by inversecow »

Hello!

Thanks for the eyes on this matter.
As requested, here is the output of that syntax, and also the syntax I used.

FYI that I had also made a backup of 'config.inc.php' ('config.inc.php.bak') in the below output, so do ignore that.

Do let me know should you wish further data.

Code: Select all

[15:03:39:user@xi_server:~]
$ ls -alh /usr/local/nrdp/server
total 44K
drwxrwxr-x 4 root root 4.0K Dec 11 13:41 ./
drwxrwxr-x 7 root root 4.0K Dec 11 09:11 ../
-rw-r--r-- 1 root root 2.9K Dec 11 13:41 config.inc.php
-rw-r--r-- 1 root root 2.7K Aug 20 09:49 config.inc.php.bak
drwxrwxr-x 2 root root 4.0K Dec 11 09:11 includes/
-rw-r--r-- 1 root root  17K Nov  5 08:51 index.php
drwxrwxr-x 5 root root 4.0K Nov  5 08:56 plugins/

Code: Select all

[15:13:55:user@xi_server:~]
$ sudo rpm -qa | grep -i nrdp
(no output returned)

Code: Select all

[15:18:04:user@xi_server:~]
$ sudo rpm -qa | grep nagiosxi
nagiosxi-nsca-5.6.8-1.el7.x86_64
nagiosxi-nagiosmobile-5.6.8-1.el7.x86_64
nagiosxi-nagiosplugins-5.6.8-1.el7.x86_64
nagiosxi-wmic-5.6.8-1.el7.x86_64
nagiosxi-ndoutils-5.6.8-1.el7.x86_64
nagiosxi-wkhtmltox-5.6.8-1.el7.x86_64
nagiosxi-mrtg-5.6.8-1.el7.x86_64
nagiosxi-nrpe-5.6.8-1.el7.x86_64
nagiosxi-pnp-5.6.8-1.el7.x86_64
nagiosxi-nagvis-5.6.8-1.el7.x86_64
nagiosxi-nagioscore-5.6.8-1.el7.x86_64
nagiosxi-5.6.8-1.el7.x86_64
nagiosxi-shellinabox-5.6.8-1.el7.x86_64
nagiosxi-nrds-5.6.8-1.el7.x86_64
nagiosxi-nxti-5.6.8-1.el7.x86_64
# YUM: Output of update command ( we have repos defined / imported into our PULP infra, but set to disabled by default on-box )

Code: Select all

sudo yum install nagiosxi --enablerepo=rhel7-nagios --enablerepo=rhel7-nagiosxi-deps

...

Updated:
  nagiosxi.x86_64 0:5.6.8-1.el7

Dependency Updated:
  nagiosxi-mrtg.x86_64 0:5.6.8-1.el7              nagiosxi-nagioscore.x86_64 0:5.6.8-1.el7         nagiosxi-nagiosmobile.x86_64 0:5.6.8-1.el7         nagiosxi-nagiosplugins.x86_64 0:5.6.8-1.el7
  nagiosxi-nagvis.x86_64 0:5.6.8-1.el7            nagiosxi-ndoutils.x86_64 0:5.6.8-1.el7           nagiosxi-nrds.x86_64 0:5.6.8-1.el7                 nagiosxi-nrpe.x86_64 0:5.6.8-1.el7
  nagiosxi-nsca.x86_64 0:5.6.8-1.el7              nagiosxi-nxti.x86_64 0:5.6.8-1.el7               nagiosxi-pnp.x86_64 0:5.6.8-1.el7                  nagiosxi-shellinabox.x86_64 0:5.6.8-1.el7
  nagiosxi-wkhtmltox.x86_64 0:5.6.8-1.el7         nagiosxi-wmic.x86_64 0:5.6.8-1.el7
“And who better understands the Unix-nature?” Master Foo asked.
“Is it he who writes the ten thousand lines, or he who, perceiving the emptiness of the task, gains merit by not coding?”
Master Foo - The ten thousand Lines
Unix Koans of Master Foo
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: NCPA: NRDP connect returns "NO TOKENS" result

Post by mbellerue »

Thank you for the additional information! I will go ahead and close this thread.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked