PDF Reports failing to generate

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

PDF Reports failing to generate

Post by derekb »

It seems PDF Reports are failing to generate, and are producing the following error:

Code: Select all

************ ERROR: Failed to render URL 'http://mydomain.com/nagiosxi//reports/notifications.php?1&hideoptions=1&username=nagiosadmin&ticket=hhlrana6&locale=en_US&records=100000' as '/usr/local/nagiosxi/tmp/scheduledreport-nagiosadmin-1434239951-page.pdf' ************
I am able to generate reports as CSV with no issues. I've some some searches, and it seems other people have experienced this issue but have not posted the answer to the problem. Any assistance would be appreciated.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: PDF Reports failing to generate

Post by Box293 »

Run this command:

Code: Select all

tail -f /var/log/httpd/error_log
Then try and generate the PDF. Do any errors appear?

Do the same again with this command running:

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

Re: PDF Reports failing to generate

Post by derekb »

Hello Box,
While running those commands, I get no output when I attempt to generate a PDF report.

Any other ideas?
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: PDF Reports failing to generate

Post by ssax »

What version of XI are you using?

Please post the output of the following commands:

Code: Select all

ls -ld /usr/local/nagiosxi
ls -ld /usr/local/nagiosxi/tmp
Also, what do you have set under Program URL and External URL in Admin > System Config > Manage System Config?
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

Re: PDF Reports failing to generate

Post by derekb »

ssax wrote:What version of XI are you using?

Please post the output of the following commands:

Code: Select all

ls -ld /usr/local/nagiosxi
ls -ld /usr/local/nagiosxi/tmp
Also, what do you have set under Program URL and External URL in Admin > System Config > Manage System Config?
Nagios XI 2014R2.7

[root@nagios nagiosxi]# ls -ld /usr/local/nagiosxi
drwxr-xr-x. 10 nagios nagios 4096 Jun 8 10:41 /usr/local/nagiosxi

[root@nagios nagiosxi]# ls -ld /usr/local/nagiosxi/tmp
drwsrwsr-x. 2 apache nagios 4096 Jun 13 20:13 /usr/local/nagiosxi/tmp

Program URL: http://nagios.mydomain.com/nagiosxi/
External URL: http://nagios.mydomain.com/nagiosxi/
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: PDF Reports failing to generate

Post by ssax »

Is selinux enabled?

Code: Select all

sestatus
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

Re: PDF Reports failing to generate

Post by derekb »

ssax wrote:Is selinux enabled?

Code: Select all

sestatus
SELinux status: disabled
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: PDF Reports failing to generate

Post by ssax »

Try running the command below and try it again:

Code: Select all

chown nagios.nagios /usr/local/nagiosxi/tmp
derekb
Posts: 177
Joined: Wed Jun 10, 2015 1:54 pm

Re: PDF Reports failing to generate

Post by derekb »

That did not work, sadly.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: PDF Reports failing to generate

Post by ssax »

Edit:

Code: Select all

/usr/local/nagiosxi/html/reports/notifications.php
Add This:

Code: Select all

$file = '/tmp/notifications_pdf.sh';
// Write the contents back to the file
file_put_contents($file, $cmd);
Right before this code:

Code: Select all

if (!file_exists($fname)) {
        echo "\n\n************\nERROR: Failed to render URL '" . $aurl . "' as '" . $fname . "'\n************\n\n";
Then refresh the page and try to generate the PDF again.

Then right away run this command to see if it works for you:

Code: Select all

sh /tmp/notifications_pdf.sh
Let me know the results, if you get any errors, send me the full output.
Locked