Can the token be auto added or retrieved for custom plugins?
-
- Posts: 6
- Joined: Wed Jan 09, 2019 11:26 am
Can the token be auto added or retrieved for custom plugins?
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?
-
- Posts: 6
- Joined: Wed Jan 09, 2019 11:26 am
Re: Can the token be auto added or retrieved for custom plug
As a follow up, is the token stored anywhere on the Nagios XI server or in the database?
Re: Can the token be auto added or retrieved for custom plug
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
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).
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}'
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 6
- Joined: Wed Jan 09, 2019 11:26 am
Re: Can the token be auto added or retrieved for custom plug
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%';
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%';
Re: Can the token be auto added or retrieved for custom plug
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!