Page 1 of 1

Availability Report - Download as PDF

Posted: Thu Apr 12, 2012 4:54 am
by htel
When I run the availability report and click "Download as PDF"

I get the following error:

FPDF error: Not a PNG file: /tmp/availabilityLRLPBT.png

Other reports the download as PDF seem to work OK.

I am using Nagios XI 2011R2.2

Regards

Re: Availability Report - Download as PDF

Posted: Thu Apr 12, 2012 9:11 am
by scottwilkerson
if you are accessing the XI site using a hostname, make sure you have the hostname in the /etc/hosts file on the line with 127.0.0.1

Re: Availability Report - Download as PDF

Posted: Thu Apr 12, 2012 9:23 am
by htel
I have added the hostname to the host file and I am getting the same error.

Hosts file:

127.0.0.1 myserver.mydomain.local localhost

Regards

Re: Availability Report - Download as PDF

Posted: Thu Apr 12, 2012 10:08 am
by scottwilkerson
you might want to look at the httpd error_log to see if it shows anything

Code: Select all

tail -f /var/log/httpd/error_log

Re: Availability Report - Download as PDF

Posted: Thu Apr 12, 2012 10:10 am
by lmiltchev
Do you have error reporting turned on in the "/etc/php.ini" file? If you do, turn it off, restart apache:

Code: Select all

service httpd restart
and try again.

Let me know if this fixes your issue.

Re: Availability Report - Download as PDF

Posted: Thu Apr 12, 2012 10:40 am
by htel
When viewing the httpd error_log I see the following:

When opening the availability report page:

Code: Select all

[Thu Apr 12 16:35:31 2012] [error] [client 10.44.20.34] PHP Notice:  Use of undefined constant LEGEND_VER - assumed 'LEGEND_VER' in /usr/local/nagiosxi/html/reports/availability.php on line 189, referer: http://myserver/nagiosxi/reports/availability.php

[Thu Apr 12 16:35:31 2012] [error] [client 10.44.20.34] PHP Notice:  Use of undefined constant LEGEND_VER - assumed 'LEGEND_VER' in /usr/local/nagiosxi/html/reports/availability.php on line 189, referer: http://myserver/nagiosxi/reports/availability.php
When clicking the "Download as PDF link":

Code: Select all

[Thu Apr 12 16:36:10 2012] [error] [client 10.44.20.34] PHP Warning:  file_get_contents() [<a href='function.file-get-contents'>function.file-get-contents</a>]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /usr/local/nagiosxi/html/reports/availability.php on line 2388, referer: http://myserver/nagiosxi/reports/availability.php

[Thu Apr 12 16:36:10 2012] [error] [client 10.44.20.34] PHP Warning:  file_get_contents(http://myserver/nagiosxi/reports/availability.php?1334244970&mode=getchart&type=host&title=Host+Availability&data=97.380149253731,2.6198507462687,0&legend=Up,Down,Unreachable&colors=%2356DA56,%23E9513D,%23CB2525&username=ict&ticket=af27fdaetqrjsro4bank7ou29v7t5facsbg9lpmjhg6ebrfl3479r6823eu5r6gl) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: Success in /usr/local/nagiosxi/html/reports/availability.php on line 2388, referer: http://myserver/nagiosxi/reports/availability.php
Then I get the error in my browser: FPDF error: Not a PNG file: /tmp/availabilityzgI2R4.png

Regards

Re: Availability Report - Download as PDF

Posted: Thu Apr 12, 2012 3:17 pm
by scottwilkerson
To verify, you have what is the equivelent of myserver in your error log in your /etc/hosts ?

Also note, if you are accessing XI from http://myserver/nagiosxi/
and in your /etc/hosts file you have

Code: Select all

127.0.0.1 myserver.mydomain.local localhost
This still isn't correct, you would need

Code: Select all

127.0.0.1 myserver myserver.mydomain.local localhost

The reason I ask is this solved the exact same issue here
http://support.nagios.com/forum/viewtop ... 35&p=23906

Re: Availability Report - Download as PDF

Posted: Fri Apr 13, 2012 3:01 am
by htel
Ahh that was the problem, it's working now!

Thank you :)