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
How to extract the 7-day availability from NagiosXI
How to extract the 7-day availability from NagiosXI
You do not have the required permissions to view the files attached to this post.
Re: How to extract the 7-day availability from NagiosXI
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:
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=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.
"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.
Re: How to extract the 7-day availability from NagiosXI
Thankyou! That worked PERFECTLY.
Thanks again.
Thanks again.