NAGIOS XI Monitoring using Automation

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
karthek
Posts: 64
Joined: Fri Aug 14, 2015 5:55 am
Location: INDIA

NAGIOS XI Monitoring using Automation

Post by karthek »

Hi,

We need to monitor multiple XI servers.
I have seen the check_nagiosxiserver.php plugin but that seems to need a token, that is generated only when XI monitoring is added through Wizard.

We have unique admin user and password on all XI servers, but when we use the token generated from one XI on other XI server the authentication fails.

We need to automate XI monitoring process and that is why we require unique username and token that could be used across XI servers. Is there anyway we could generate this token?

Any thoughts?
"Machines don't make mistakes, we do."
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: NAGIOS XI Monitoring using Automation

Post by tacolover101 »

what is your ultimate goal to achieve when you say you'd like to monitor multiple XI servers? this may help to point you in a better direction.

then Tokens are going to change between servers by nature, since they're tokens, but they should allow you to use the plugin successfully across the board. i don't think that these are presented over the API at all, so it takes out a bit of the 'automation' possibility.
karthek
Posts: 64
Joined: Fri Aug 14, 2015 5:55 am
Location: INDIA

Re: NAGIOS XI Monitoring using Automation

Post by karthek »

We are trying to monitor XI servers using our (in house built) passive agent. Our agent can run scripts and send exit codes to XI servers.

Example: We would install Passive Agent on a Linux machine and monitor all our XI servers, using the plugin check_nagiosxiserver.php. Right now we need to specify seperate token for each XI. Our goal is to generate a token, that we could use to monitor all our XI servers, since we use same username.

Hope you understood.
"Machines don't make mistakes, we do."
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: NAGIOS XI Monitoring using Automation

Post by tacolover101 »

i do understand. you'd like to make the token static across the board.

i don't have XI installed currently, but from what I recall, it doesn't allow you to manually specify the token. so.... this isn't advised to modify variables at the database manually. you'll have to look at the XI database, more than likely it'll be the 'xi_users' table which has a token specified for 'nagiosadmin'. standardize that on all of your installs, and you should be good to go.
karthek
Posts: 64
Joined: Fri Aug 14, 2015 5:55 am
Location: INDIA

Re: NAGIOS XI Monitoring using Automation

Post by karthek »

Got it..

Is there any API calls to get the nagios daemons status?
"Machines don't make mistakes, we do."
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: NAGIOS XI Monitoring using Automation

Post by tacolover101 »

yeah - i can't recall the URL off of the top of my head. it's what the system status page calls to, to check the health on services for itself.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NAGIOS XI Monitoring using Automation

Post by tgriep »

If you go to the Help > System Reference menu, it shows an example of how to get the status on an XI server using API.
This is an example of what it looks like.

Code: Select all

http://192.168.1.1/nagiosxi/api/v1/system/status?apikey=apikey55&pretty=1
It just shows the status of the Nagios process.


If you do want to set the token on all of the servers to the same one, it can be done by editing the backend_ticket key.
The following command will set the API key to the example of 12345678 for the nagiosadmin user account. You would have to run it on all of the servers.

Code: Select all

mysql -u root -pnagiosxi nagiosxi -e "UPDATE xi_users SET backend_ticket = '12345678' WHERE username='nagiosadmin'";
Make sure the systems are backed up in case something goes wrong and you can revert back if needed.
Be sure to check out our Knowledgebase for helpful articles and solutions!
karthek
Posts: 64
Joined: Fri Aug 14, 2015 5:55 am
Location: INDIA

Re: NAGIOS XI Monitoring using Automation

Post by karthek »

If you do want to set the token on all of the servers to the same one, it can be done by editing the backend_ticket key.
The following command will set the API key to the example of 12345678 for the nagiosadmin user account. You would have to run it on all of the servers.
Exactly what i was looking for. I'll test it and let you know the status.

Thank you!
"Machines don't make mistakes, we do."
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NAGIOS XI Monitoring using Automation

Post by tgriep »

Your Welcome.
Be sure to check out our Knowledgebase for helpful articles and solutions!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NAGIOS XI Monitoring using Automation

Post by scottwilkerson »

karthek wrote:
If you do want to set the token on all of the servers to the same one, it can be done by editing the backend_ticket key.
The following command will set the API key to the example of 12345678 for the nagiosadmin user account. You would have to run it on all of the servers.
Exactly what i was looking for. I'll test it and let you know the status.

Thank you!
If you need further assistance let us know.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked