Nagios XI 2012R2.2 / FPDF not working since upgrade

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
IMTECH
Posts: 53
Joined: Fri Nov 25, 2011 6:35 am

Nagios XI 2012R2.2 / FPDF not working since upgrade

Post by IMTECH »

Hi,

after the upgrade from 1.6 to 2.2 some weeks ago it seems that the PDF generation in Nagios XI is broken for me.

The error message that is displayed when eg. trying show the availability report in PDF is: "FPDF error: Unsupported image type: png "
When I schedule a report a broken PDF is send by mail which is around 200-300 Bytes of size.

As i saw it in a different thread with a similar issue, maybe this information helps.

I checked /var/log/httpd/error_log but there is no entry at the time I try to generate the PDF.

cat /etc/php.ini | grep display_errors
; display_errors
display_errors = Off
; separately from display_errors. PHP's default behavior is to suppress those

/etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
(besides of several other entries that are customer-related, but nothing with the server-hostname in it)

Any ideas on this issue?

Thanks in advance!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios XI 2012R2.2 / FPDF not working since upgrade

Post by abrist »

Try to reinstall wkhtml (this requires the XI tarball to be expanded in /tmp):
Open the install file in a text editor:

Code: Select all

    vi /tmp/nagiosxi/subcomponents/wkhtml/install
and change line 17 from this:

Code: Select all

    installpath = os.environ['INSTALL_PATH']
to this:

Code: Select all

    installpath = '/tmp/nagiosxi'
Save the file and try to run the install again:

Code: Select all

    cd /tmp/nagiosxi/subcomponents/wkhtml/
    ./install
What are the exact errors you are seeing in the apache error log?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
IMTECH
Posts: 53
Joined: Fri Nov 25, 2011 6:35 am

Re: Nagios XI 2012R2.2 / FPDF not working since upgrade

Post by IMTECH »

Code: Select all

[root@xxx wkhtml]# ./install
--2013-07-17 10:32:52--  http://assets.nagios.com/downloads/nagiosxi/components/wkhtmltopdf-0.10.0_rc2-static-amd64.tar.bz2
Resolving assets.nagios.com... 72.14.181.71
Connecting to assets.nagios.com|72.14.181.71|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10995568 (10M) [application/x-bzip2]
Saving to: âwkhtmltopdf-0.10.0_rc2-static-amd64.tar.bz2â

100%[========================================================================================================>] 10,995,568  88.3K/s   in 1m 59s

2013-07-17 10:34:52 (90.3 KB/s) - âwkhtmltopdf-0.10.0_rc2-static-amd64.tar.bz2â
Should there be any installation going on?
As far as I can tell, the package was only downloaded.

There are no errors in the apache logfile that are directly related to this action.
eg. PHP Notice: Undefined variable: startdate in /usr/local/nagiosxi/html/includes/components/graphexplorer/visFunctions.inc.php on line 135, referer: http://xxx/nagiosxi//includes/page-home-main.php?&=
or Exception KeyError: KeyError(139726975993824,) in <module 'threading' from '/usr/lib64/python2.6/threading.pyc'> ignored
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios XI 2012R2.2 / FPDF not working since upgrade

Post by abrist »

IMTECH wrote:Should there be any installation going on?
Looking back over the script, there is another script that expands and copies the bin. We will just do it by hand. Untar it to /tmp, and copy the binary that matches your arch to /usr/bin/wkhtmltopdf :

Code: Select all

cd /tmp
(for 64 bit)

Code: Select all

tar xvf wkhtmltopdf-0.10.0_rc2-static-amd64.tar.bz2
cp wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf
(for 32 bit)

Code: Select all

tar xvf wkhtmltopdf-0.10.0_rc2-static-i386.tar.bz2
cp wkhtmltopdf-i386 /usr/bin/wkhtmltopdf
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
IMTECH
Posts: 53
Joined: Fri Nov 25, 2011 6:35 am

Re: Nagios XI 2012R2.2 / FPDF not working since upgrade

Post by IMTECH »

Executed the mentioned commands, but the error is still unchanged - "FPDF error: Unsupported image type: png".
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios XI 2012R2.2 / FPDF not working since upgrade

Post by slansing »

Is this happening on all reports? Or just the aforementioned?
IMTECH
Posts: 53
Joined: Fri Nov 25, 2011 6:35 am

Re: Nagios XI 2012R2.2 / FPDF not working since upgrade

Post by IMTECH »

Happens on the following reports:
Availability
State History
Top Alert Producers
Alert Histogram
Notifications
Event Log

Works with:
Executive Summary

Does not happen on a self-scheduled report like "http://xxx/nagiosxi/?xiwindow=http%3A%2 ... ttr%3D4096" which has been created with "Schedule page".
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios XI 2012R2.2 / FPDF not working since upgrade

Post by abrist »

I am perplexed. PNGs are a supported format of FPDF . . .
Do you use the custom logo component?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
IMTECH
Posts: 53
Joined: Fri Nov 25, 2011 6:35 am

Re: Nagios XI 2012R2.2 / FPDF not working since upgrade

Post by IMTECH »

That was a real good point!

When I deactivate the Custom Logo-Component all the reports do work again ... but actually we use a PNG as logo.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios XI 2012R2.2 / FPDF not working since upgrade

Post by slansing »

Could you try changing that logo to, maybe a JPEG? And enabling it?
Locked