Issue during printing report to PDF or JPG

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
xdatanet
Posts: 29
Joined: Wed Sep 04, 2013 10:06 am
Location: Mirandola Italy

Issue during printing report to PDF or JPG

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

Re: Issue during printing report to PDF or JPG

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
xdatanet
Posts: 29
Joined: Wed Sep 04, 2013 10:06 am
Location: Mirandola Italy

Re: Issue during printing report to PDF or JPG

Post 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.
xdatanet
Posts: 29
Joined: Wed Sep 04, 2013 10:06 am
Location: Mirandola Italy

Re: Issue during printing report to PDF or JPG

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

Re: Issue during printing report to PDF or JPG

Post by scottwilkerson »

did you manually install a 32 bit version on a 64 bit system or vise-versa?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
xdatanet
Posts: 29
Joined: Wed Sep 04, 2013 10:06 am
Location: Mirandola Italy

Re: Issue during printing report to PDF or JPG

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

Re: Issue during printing report to PDF or JPG

Post 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!
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
jomann
Development Lead
Posts: 611
Joined: Mon Apr 22, 2013 10:06 am
Location: Nagios Enterprises

Re: Issue during printing report to PDF or JPG

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
xdatanet
Posts: 29
Joined: Wed Sep 04, 2013 10:06 am
Location: Mirandola Italy

Re: Issue during printing report to PDF or JPG

Post by xdatanet »

The newer versions have issues generating PDFs when using a self-signed SSL certificates.
I have understood... Now it's clear. ;)

Thanks.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Issue during printing report to PDF or JPG

Post by tmcdonald »

Did you have further (related) questions or are we good to lock this up?
Former Nagios employee
Locked