Page 1 of 1

Running reports external to the GUI

Posted: Mon May 25, 2015 11:30 pm
by Fred Kroeger
I was wondering if it was possible to run a report such as the SLA report from the command line?
The SLA Report is perfect for what I need in that I can report on a hostgroup over business hours, but I would like to access the raw output rather than generate a PDF. This is so that I can upload the info into a Data Warehouse.
Any ideas ?

regards... Fred

Re: Running reports external to the GUI

Posted: Tue May 26, 2015 10:36 am
by lmiltchev
Fred, I am not sure what you mean by "...I would like to access the raw output...". In the GUI, you can view the SLA report, schedule it/email it, save it as PDF or JPG... You can still save it as PDF from the command line by doing the following:

1. Grab the report URL (right click on the "PDF" button and open in a new tab)
2. Get the "username" and the "ticket" from the "Backend API URL" component and append it to the end of the report URL
3. Run, something like this from the CLI:

Code: Select all

curl "http://192.168.x.x/nagiosxi/reports/sla.php?1&mode=pdf&username=nagiosadmin&ticket=pkus66xx" > /tmp/sla.pdf
Does this help?

Re: Running reports external to the GUI

Posted: Tue May 26, 2015 6:26 pm
by Fred Kroeger
Yes thanks - this is a great help.
When I asked about raw output it was really about what other formats I could export the report in. On the GUI, only PDF is supported.
I tried using mode=csv but got a message saying that it is not supported. What other modes can I use?
Basically all I need to do is to extract the Uptime SLA for a hostgroup and send it to a Data Warehouse for reporting

regards.. Fred

Re: Running reports external to the GUI

Posted: Wed May 27, 2015 11:20 am
by abrist
Only JPGs and PDFs are currently supported. We will add csv sometime in the future.

Re: Running reports external to the GUI

Posted: Wed May 27, 2015 7:05 pm
by Fred Kroeger
Thanks - it would be really good to have these features so that we can use the great data in Nagios to feed into other reporting systems in an enterprise environment.

regards... Fred

Re: Running reports external to the GUI

Posted: Thu May 28, 2015 10:21 am
by lmiltchev
Fred, I just posted an internal feature request (TASK ID 5717).

Re: Running reports external to the GUI

Posted: Thu May 28, 2015 7:53 pm
by Fred Kroeger
Thanks Ludmil - much appreciated

Fred

Re: Running reports external to the GUI

Posted: Fri May 29, 2015 9:03 am
by tmcdonald
Going to close this since a feature request has been made.