Availaibility Report to PDF in Core 4.0.8

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
bluesymbol
Posts: 1
Joined: Fri Apr 10, 2015 8:19 am

Availaibility Report to PDF in Core 4.0.8

Post by bluesymbol »

Hi Everyone,

This is my first post here please be gentle! I've used nagios as a user for a while but this is the first system I've had to configure and I'm not a linux expert!!!

I've got Core 4.0.8 running happily on Ubuntu Server 14.04 however I've been asked to get PDF reports of the Host Availability to be emailed out on a monthly basis, My initial thoughts were to use something like WKHTMLTOPDF, sending via Postfix on a monthly Cronjob.

HOWEVER, I run the below command as nagiosadmin to create the PDFs...

Code: Select all

su - nagiosadmin  /usr/local/bin/wkhtmltopdf.sh "http://x.x.x.x/nagios/cgi-bin/avail.cgi?show_log_entries=&hostgroup=windows-servers&timeperiod=last31days&smon=4&sday=1&syear=2015&shour=0&smin=0&ssec=0&emon=4&eday=9&eyear=2015&ehour=24&emin=0&esec=0&rpttimeperiod=&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=3&initialassumedservicestate=0&backtrack=4" /home/nagiosadmin/all_hosts_last31days.pdf
Now, if i browse to the address in a web browser, the page loads as expected and I can see the report. BUT if I run the command from the command line I get the below...

Code: Select all

nagiosadmin@nagios:/home$ su - nagiosadmin  /usr/local/bin/wkhtmltopdf.sh "http://127.0.0.1/nagios/cgi-bin/avail.cgi?show_log_entries=&hostgroup=windows-servers&timeperiod=last31days&smon=4&sday=1&syear=2015&shour=0&smin=0&ssec=0&emon=4&eday=9&eyear=2015&ehour=24&emin=0&esec=0&rpttimeperiod=&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=3&initialassumedservicestate=0&backtrack=4" /home/nagiosadmin/all_hosts_last31days.pdf
Password:
Loading page (1/2)
Printing pages (2/2)
Done
It generates the PDF document and all it contains is the below...
Forbidden
You don't have permission to access /nagios/cgi-bin/avail.cgi on this server.

Does anyone have any suggestions?? Note, it works for other sites, just not nagios.

Thanks!

Ash
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Availaibility Report to PDF in Core 4.0.8

Post by tmcdonald »

If I can put on my Sales hat for a moment, we have this exact functionality in our commercial product, Nagios XI. Scheduled reporting emailed out in PDF form, with options to filter by hostgroup, time period, etc. If you are going to be doing a lot with reports like this I would strongly recommend taking a look at our demo: http://www.nagios.com/downloadxi
Former Nagios employee
Locked