Can the token be auto added or retrieved for custom plugins?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
meganoliver
Posts: 6
Joined: Wed Jan 09, 2019 11:26 am

Can the token be auto added or retrieved for custom plugins?

Post by meganoliver »

When creating/updating custom plugins after the initial NCPA configuration to Nagios XI, since the token needs to be defined in $ARG1$ of each service check definition, is there a way to automatically retrieve this token if the NCPA has already been configured to Nagios XI?
meganoliver
Posts: 6
Joined: Wed Jan 09, 2019 11:26 am

Re: Can the token be auto added or retrieved for custom plug

Post by meganoliver »

As a follow up, is the token stored anywhere on the Nagios XI server or in the database?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Can the token be auto added or retrieved for custom plug

Post by lmiltchev »

The token is defined on the client (remote machine). It will be present in Nagios XI too (in the check commands) if there are NCPA services configured.

If you added your NCPA services by running the NCPA wizard, you could probably view the tokens for all NCPA services by running this very ugly command :)

Code: Select all

grep -R ncpa /usr/local/nagios/etc/services | grep check_command | cut -d '!' -f 2 | awk '{print $2}'
or you could just open one of the NCPA services in the CCM, and find the token (right after the "-t" flag in the $ARG1$ field).
Be sure to check out our Knowledgebase for helpful articles and solutions!
meganoliver
Posts: 6
Joined: Wed Jan 09, 2019 11:26 am

Re: Can the token be auto added or retrieved for custom plug

Post by meganoliver »

Thank you!

We were able to figure out where the token is stored and it's associated server in the database by running this query:
SELECT * FROM nagiosxi.xi_meta WHERE keyname LIKE '%hostname%';
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Can the token be auto added or retrieved for custom plug

Post by lmiltchev »

I am glad your issue has been resoled! I am closing this topic now. I you have any further questions, please start a new thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked