Nagios Availability Reports to pdf via wkhtmltopdf and crontab.

This is an addon to Nagios3.x web interface , you can get Nagios Availability Reports to pdf thanks to wkhtmltopdf app. : http://code.google.com/p/wkhtmltopdf/

you only have to install wkhtmltopdf in your sistem, genetare pdfs and link to your side.php.

There is a little problem, you have to disable cgi authorization to get cgi-htmls converted into pdf without problem, (this is not a problem in a secure enviroment)

Here my example:

1. Get and install wkhtmltopdf, via apt, rpm, source code, etc...

2. Run pdf generation:
/usr/bin/wkhtmltopdf "http://xx.xxx.x.xx/nagios/cgi-bin/avail.cgi?show_log_entries=&host=all&timeperiod=last7days&smon=8&sday=1&syear=2010&shour=0&smin=0&ssec=0&emon=8&eday=31&eyear=2010&ehour=24&emin=0&esec=0&rpttimeperiod=&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=0&initialassumedservicestate=0&backtrack=4" /path_to_place_your_pdf_reports/all_hosts_last7days.pdf

3. You can put in a crontab to run weekly in this case.

4. Add a link into your side.php:

<li><a href="<?php echo $cfg["cgi_base_url"];?>/avail.cgi" target="<?php echo $link_target;?>">Availability</a>
<ul>
<li><a href="/path_to_place_your_pdf_reports/all_hosts_last7days.pdf" target="<?php echo $link_target;?>">Hosts_Weekly pdf</a></li>
</ul>
</li>