Page 1 of 1

Issue during printing report to PDF or JPG

Posted: Wed Jul 18, 2018 7:33 am
by xdatanet
I cannot return back to the past therefore I cannot know the exact version cause me the problem.

Some months ago, approximately around 5.4.5/5.4.6 I can print pdf/jpg report without problems.
Yesterday I tryed to migrate to 5.5.1 from 5.5.0 with documented tilde error and wkhtmltox rpm update.
I could upgrade without problem but then I decide to go back to 5.5.0 (by snapshot of the vm) because I wanted to check report export.
Indeed It did not work. The error is an SQL Error about the non existence of unix_timestamp funcion.

I documented myself about it and I discovered that the function does not exist in PostgresSQL but only in MySQL.
Then I discovered that Nagios, from 5 version, uses only MySQL.

Do you think I need to migrate to MySQL also with NagiosXI db following the guide?

Regards,
Graziano.

Re: Issue during printing report to PDF or JPG

Posted: Wed Jul 18, 2018 7:44 am
by scottwilkerson
xdatanet wrote:I documented myself about it and I discovered that the function does not exist in PostgresSQL but only in MySQL.
This fix was in 5.5.1, so going back to 5.5.0 will have the bug with the function that does not exist

Re: Issue during printing report to PDF or JPG

Posted: Thu Jul 19, 2018 2:36 am
by xdatanet
Ok, indeed the error after upgrade is:

"Failed to create pdf

Verify that your Nagios XI server can connect to the URL:

http://localhost/nagiosxi/reports/avail ... 1&export=1"

And this is because I decided to roll back... :?

Regards,
Graziano.

Re: Issue during printing report to PDF or JPG

Posted: Thu Jul 19, 2018 8:10 am
by xdatanet
Maybe a problem with manual update of wkhtmltox libs???

Code: Select all

[Thu Jul 19 14:36:48 2018] [error] [client 192.168.3.146] PHP Warning:  array_key_exists() expects parameter 2 to be array, null given in /usr/local/nagiosxi/html/dashboards/dashboard.php on line 0, referer: http://nagiosxi.xdatanet.com/nagiosxi/dashboards/
sh: /usr/bin/wkhtmltopdf: No such file or directory
sh: /usr/bin/wkhtmltopdf: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
sh: /usr/bin/wkhtmltoimage: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
The link exists in /usr/bin/ and also the files in /usr/local/bin/...

Really we have to update to 12.1.3?? This is a 2014 version... :shock:

Regards,
Graziano.

Re: Issue during printing report to PDF or JPG

Posted: Thu Jul 19, 2018 8:26 am
by scottwilkerson
did you manually install a 32 bit version on a 64 bit system or vise-versa?

Re: Issue during printing report to PDF or JPG

Posted: Thu Jul 19, 2018 9:02 am
by xdatanet
To make a summary for CentoOS 6.4...

Before upgrading:
- NagiosXI 5.5.0;
- wkhtlmtox version 12.5.0;
- error printing in jpg and pdf due unix_timestamp funciont bug in NagiosXI resolved in 5.5.1;
- launching wkhtmltopdf from command line it works like a charm...;

The correct step to migrate is:
- download the 5.5.1 upgrade files, decompress, open upgrade script and comment around line 1232 the install procedure included parenthesis;
- launch the upgrade;
- at the end of upgrade process the wkhtmltox didn't work anymore...
- download the latest patch of wkhtmltox, wkhtmltox-0.12.5-1.centos6.x86_64.rpm;
- install the rpm with rpm -ihv wk[...]. rpm

Now it works again. :D

Regards,
Graziano.

Re: Issue during printing report to PDF or JPG

Posted: Thu Jul 19, 2018 9:11 am
by scottwilkerson
xdatanet wrote:To make a summary for CentoOS 6.4...

Before upgrading:
- NagiosXI 5.5.0;
- wkhtlmtox version 12.5.0;
- error printing in jpg and pdf due unix_timestamp funciont bug in NagiosXI resolved in 5.5.1;
- launching wkhtmltopdf from command line it works like a charm...;

The correct step to migrate is:
- download the 5.5.1 upgrade files, decompress, open upgrade script and comment around line 1232 the install procedure included parenthesis;
- launch the upgrade;
- at the end of upgrade process the wkhtmltox didn't work anymore...
- download the latest patch of wkhtmltox, wkhtmltox-0.12.5-1.centos6.x86_64.rpm;
- install the rpm with rpm -ihv wk[...]. rpm

Now it works again. :D

Regards,
Graziano.
Glad this works! I am going to pass this on to the developers to get it changed in the upgrade script

Thanks!

Re: Issue during printing report to PDF or JPG

Posted: Thu Jul 19, 2018 9:19 am
by jomann
Just a little extra info on this in case anyone is wondering why we're using the old version. The newer versions have issues generating PDFs when using a self-signed SSL certificates. If you're not using them, or if it's working fine on your system, it shouldn't be a problem using the latest wkhtmltox rpm.

Re: Issue during printing report to PDF or JPG

Posted: Fri Jul 20, 2018 1:48 am
by xdatanet
The newer versions have issues generating PDFs when using a self-signed SSL certificates.
I have understood... Now it's clear. ;)

Thanks.

Re: Issue during printing report to PDF or JPG

Posted: Fri Jul 20, 2018 9:39 am
by tmcdonald
Did you have further (related) questions or are we good to lock this up?