Page 1 of 1

Getting backend data from the API

Posted: Fri Dec 13, 2019 12:22 pm
by gregwhite
I am trying to get data out of NagiosXI that will show at least the host, hostgroup, IP Address, and Alias. When I choose the 'Manage Components" and then use this URL
http://sherlock/nagiosxi/backend/?cmd=g ... 9e5uf5otrq

It appears this will give me the information that I need but it never completes.

Thanks,
Greg

Re: Getting backend data from the API

Posted: Fri Dec 13, 2019 1:58 pm
by benjaminsmith
Hi Greg,

What version of Nagios XI are you currently using? The Backed API has been deprecated in Nagiso XI 5 and now uses a REST API.

If that's not the issue, run the following tail command while you try to load that page, and post the output. Thanks.

Code: Select all

tail -f /var/log/httpd/*error_log
Documenation
Backend API Access

Re: Getting backend data from the API

Posted: Fri Dec 13, 2019 2:52 pm
by gregwhite
Got the information, thanks!!

One more question: We have our routers and switches using the interface table plugin. All the interfaces are displayed. Do you know if it is possible to pull that information - the router and its interfaces into a spreadsheet.

Thanks,
Greg

Re: Getting backend data from the API

Posted: Fri Dec 13, 2019 3:24 pm
by benjaminsmith
Hi Greg,

Can you post a screenshot of the information in the Nagios XI interface that you would like to get to CSV? Thanks.

The best option may be to send the page as a schedule report in a PDF format and use a utility to import this into a spreadsheet.

Re: Getting backend data from the API

Posted: Fri Dec 13, 2019 3:55 pm
by gregwhite
Attached is the screen shot of what the interface table looks like.

Re: Getting backend data from the API

Posted: Fri Dec 13, 2019 4:26 pm
by benjaminsmith
Hi Greg,

Ok, that looks like the plugin output, and you should be able to run the plugin directly from the command line and pipe the output to a file since the plugin is outputting html.

Next, you shoudl be able to directly import the html file into xcel, otherwise, try to use a script to convert the html tables to csv (see this or this).

Let me know if you have other questions.