nagios backend api

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

nagios backend api

Post 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?
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagios backend api

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nagios backend api

Post by benhank »

Thanks man
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagios backend api

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nagios backend api

Post by benhank »

thanks you can lock it up.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
Locked