Page 1 of 2

Failed to create PDF/JPED on Report

Posted: Thu Feb 25, 2021 5:00 am
by sacom01
hi team,
i am facing issue with Report on nagios xi web as attach file.
iptables already stopped. and restart nagios/http service but not work.

[root@dc-nagiosxi-uat01 var]# wkhtmltopdf -V
wkhtmltopdf 0.12.1.3 (with patched qt)
[root@dc-nagiosxi-uat01 var]# which wkhtmltopdf
/usr/local/bin/wkhtmltopdf
[root@dc-nagiosxi-uat01 var]# service nagios restart
Redirecting to /bin/systemctl restart nagios.service
[root@dc-nagiosxi-uat01 var]#
[root@dc-nagiosxi-uat01 var]# service httpd restart
Redirecting to /bin/systemctl restart httpd.service

[root@dc-nagiosxi-uat01 var]# tail -f /var/log/httpd/error_log
Loading page (1/2)=====================================> ] 90%
Loading pages (1/6)====================================> ] 90%
[Thu Feb 25 15:34:40.696354 2021] [:error] [pid 16158] [client 192.168.xxx.x:51972] Could not resolve host: api.nagios.com; Name or service not known, referer: http://192.168.xxx.xxx/nagiosxi/login.php
Loading page (1/2)
Loading pages (1/6)====================================> ] 90%
[Thu Feb 25 15:36:02.015044 2021] [:error] [pid 54036] [client 192.168.xxx.x:52059] Could not resolve host: api.nagios.com; Name or service not known, referer: http://192.168.xxx.xxx/nagiosxi/login.php
Loading pages (1/6)
Loading pages (1/6)====================================> ] 90%
Loading pages (1/6)====================================> ] 90%
[======================================================> ] 90%

Note : sometime it work, sometime not.
thank you.

Re: Failed to create PDF/JPED on Report

Posted: Thu Feb 25, 2021 3:37 pm
by benjaminsmith
Hi,

If it's working on and off, something might be timing out. The version of wkhtmltopdf is correct.

Can you provide a screenshot of the System Settings? Click on Admin > System Settings to view them.

The report use those URL,s to generate the report. Also, let's check the etc/hosts file.

Code: Select all

cat /etc/hosts
If you haven't done so already, please optimize the PHP settings for this server.

Nagios XI - Optimizing The PHP Settings File

I noticed in the logs the server is not connecting the Nagios license server, does the system have access to the internet? Are you using any kind of proxies?

Thanks,
Benjamin

Re: Failed to create PDF/JPED on Report

Posted: Sun Feb 28, 2021 9:39 pm
by sacom01
hi,
the server could not access to internet due to our policy.

[root@nagiosxi-uat01 libexec]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

Re: Failed to create PDF/JPED on Report

Posted: Mon Mar 01, 2021 5:55 pm
by benjaminsmith
Hi,

The URL settings and etc/hosts file look normal. Since this is happening on and off, let's bump up the timeouts in the php.ini beyond what is recommended in the kb article.

Code: Select all

max_execution_time = 300
max_input_time = 300
And then res-start Apache. Also, If you vary the time period of the report, does that have any impact on whether the report completes or not.

If you go to Reports > Legacy Reports > Availablity, are you able to generate those without errors?

Can you PM the system profile and I'll check the logs as well. Thanks, Benjamin

To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button

Re: Failed to create PDF/JPED on Report

Posted: Tue Mar 02, 2021 9:47 pm
by sacom01
hi ben,
pls check inbox, i sent you already.
thank you

Re: Failed to create PDF/JPED on Report

Posted: Wed Mar 03, 2021 6:05 pm
by benjaminsmith
Hi,

Thanks for the profile. The one error that is standing out in the Apache logs is the following:

Code: Select all

PHP Fatal error:  Call to undefined function get_backend_xml_data() in /usr/local/nagiosxi/html/includes/components/globaleventhandler/globaleventhandler.inc.php on line 506, referer: 
Are you using the Global Event Handlers component? If so, can you try to disable the commands temporarily and test again?

We've added a new feature in 5.8.x to help with these types of issues. Would you be able to upgrade to the latest version and then increase the default delay on the report by going to Admin > System Config > Performance Settings > PDF/JPEG Exporting.
report-delay.png
To upgrade make a full backupand then follow the instructions below.

https://assets.nagios.com/downloads/nag ... ctions.pdf

Benjamin

Re: Failed to create PDF/JPED on Report

Posted: Wed Mar 03, 2021 10:52 pm
by sacom01
hi ben,
i tried stop Event Handler and export file but still facing the error.
actually, even before use Event Handler it still getting same error bro.

but luckyly, i upgrade to 5.8 version and it work fine.

We do not internet access on the server due to the policy, so have to download offline package and upgrade.
But we have to install a new server with 5.7 version after that upgrade, because upgrading only success if it is a clean system (a bare minimal install with nothing else installed or configured).

So if we have a system with many configured, unable to upgrade. Don't know another client who is using nagios less than 5.8 version, how to upgrade their system.

thank you.

Re: Failed to create PDF/JPED on Report

Posted: Thu Mar 04, 2021 5:37 pm
by benjaminsmith
Hi
but luckyly, i upgrade to 5.8 version and it work fine.
Glad to hear that took care of it.

On the second question, I'm a little unclear. Yes, for a new installation it needs to be a clear, minimal system, For example, it needs to be a dedicated server, not something running other applications that may cause conflicts.
So if we have a system with many configured, unable to upgrade
Can you elaborate on 'many configured'? Is this some type of customization?

--Benjamin

Re: Failed to create PDF/JPED on Report

Posted: Sun Mar 07, 2021 9:56 pm
by sacom01
hi ben,
"Can you elaborate on 'many configured'? Is this some type of customization?"
--> example i am using nagios xi version 5.7 and create many commands, many services, many schedule report...
so it will can not be upgraded to 5.8 due to it is not a new system, i already tried do that on my svr.

So how can to upgrade version in this case?

thank you.

Re: Failed to create PDF/JPED on Report

Posted: Mon Mar 08, 2021 3:46 pm
by benjaminsmith
Hi,

Okay thanks, I think I got it.

For that type of migration, it's necessary to put an older version on the new server and then upgrade to 5.8. You can download older versions on the following page.

https://repo.nagios.com/?repo=offline

Benjamin

Reference:
https://support.nagios.com/kb/article/m ... r-892.html