Page 1 of 1

nagios backend api

Posted: Mon May 06, 2013 10:22 am
by benhank
Hey Team waddup!

I just have a question:
Are there instructions for integrating the backend api urls into a website?
Basically I want to set up a "page" that will display our top ten alerts. This page is on a company intranet. What would be saaaweeeet is if yall know a way to display nagvis maps too. Thanks guys.
Oh as an aside, I actually got a lot of questions, not involving issues to be resolved (nuthin is broke). Can I post them in one post or do you prefer separate ones?

Re: nagios backend api

Posted: Mon May 06, 2013 3:16 pm
by abrist
You can use the backend ticketing system to access the XI server's top alert producers report. First make a read only user in XI and then get the user's backend ticket. Go to Admin --> Manage Components --> Backend API URL --> click the Tools icon to right --> Choose the new read only user from the drop down --> Copy the last part of one of the urls listed. It should resemble:

Code: Select all

username=readonlyuser&ticket=hd76ueiw
Now get the direct URL for the page you want to access by right clicking it's menu link and copying the link address. For the top alert producer report, the url is:

Code: Select all

http://<xi server ip>/nagiosxi/reports/topalertproducers.php
Now append the user and ticket information ( don't forget the '?' ):

Code: Select all

http://<xi server ip>/nagiosxi/reports/topalertproducers.php?username=readonlyuser&ticket=hd76ueiw
If there are already backend args, you can just append the ticket information to the url with and '&' :

Code: Select all

https://<xi server ip>nagiosxi/includes/components/xicore/status.php?show=hosts&username=readonlyuser&ticket=hd76ueiw
If you need to parse the raw XML on another machine (if our current urls do not include the exact information you want), you will have to code your own or talk to [email protected] for a consultation/custom development quote.

The reason for a read only user is that the ticket url essentially logs the user in. Read-only is for security purposes, though I would still limit this access to the internal network, just in case.

I am not quite sure about the nagvis question, maybe we can get some help?

Re: nagios backend api

Posted: Tue May 07, 2013 11:29 am
by benhank
Thanks man

Re: nagios backend api

Posted: Tue May 07, 2013 11:50 am
by abrist
No problem good sir. You may want to open a new thread for the nagvis question. The procedure above can more or less be applied to almost any page in XI.

Re: nagios backend api

Posted: Tue May 28, 2013 2:10 pm
by benhank
thanks you can lock it up.