Availability Report - Download as PDF

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
htel
Posts: 32
Joined: Tue Mar 01, 2011 10:03 am

Availability Report - Download as PDF

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Availability Report - Download as PDF

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
htel
Posts: 32
Joined: Tue Mar 01, 2011 10:03 am

Re: Availability Report - Download as PDF

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Availability Report - Download as PDF

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Availability Report - Download as PDF

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
htel
Posts: 32
Joined: Tue Mar 01, 2011 10:03 am

Re: Availability Report - Download as PDF

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Availability Report - Download as PDF

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
htel
Posts: 32
Joined: Tue Mar 01, 2011 10:03 am

Re: Availability Report - Download as PDF

Post by htel »

Ahh that was the problem, it's working now!

Thank you :)
Locked