How to extract the 7-day availability from NagiosXI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ninety
Posts: 8
Joined: Wed Jan 05, 2011 4:23 am

How to extract the 7-day availability from NagiosXI

Post by ninety »

Hi
In our monitoring station, we need to have the 7-day availability of all monitored hosts displayed on a monitor.

I can get the data on a browser just fine, but I need to "scrape" that data so I can use it in our own HTML.

using lynx or wget either returns "Your session has timed out" or "Your browser doesn't support frames".

Is there a "proper" way I can get the number from command line?

Thanks

Colin
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How to extract the 7-day availability from NagiosXI

Post by abrist »

Alright. First, you need the actual url for the availability report. Right click on the menu link under reports for "Availability". Open it in a new tab. Make you modifications to the forms (last week, etc) and click go. The report should update and the url should populate with the get vars. Copy the full url, it should be similar to:

Code: Select all

http://<ip>/nagiosxi/reports/availability.php?host=&service=&reportperiod=thisweek&startdate=&enddate=&reporttimesubmitbutton=Go&host=&hostgroup=&servicegroup=
Now, in order to access it externally, you will need to create a read only XI user.

Once created, get the ticket id for the user --> go to Admin --> Manage Components --> Backend API URL (edit) --> choose your new, read only user from the dropdown. At the end of the forms you will find a username and ticket id in the format of: &username=<username>&ticket=<long ole ticket id>

Append the credentials to the url above. The final url should resemble:

Code: Select all

http://<ip>/nagiosxi/reports/availability.php?host=&service=&reportperiod=thisweek&startdate=&enddate=&reporttimesubmitbutton=Go&host=&hostgroup=&servicegroup=&username=<username>&ticket=<long ole ticket id>
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.
ninety
Posts: 8
Joined: Wed Jan 05, 2011 4:23 am

Re: How to extract the 7-day availability from NagiosXI

Post by ninety »

Thankyou! That worked PERFECTLY.

Thanks again.
Locked