PDF reports not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nbdstl
Posts: 16
Joined: Fri Apr 24, 2015 9:11 am

PDF reports not working

Post by nbdstl »

System Profile
Nagios XI Version : 2014R2.7
**hostname** 3.10.0-229.4.2.el7.x86_64 x86_64
CentOS Linux release 7.1.1503 (Core)
Gnome is not installed

When trying to generate PDF reports for immediate viewing I'm getting an error:
************ ERROR: Failed to render URL 'https://hostname/nagiosxi//reports/execsummary.php?1&reportperiod=last24hours&startdate=&enddate=&host=&hostgroup=linux-servers&servicegroup=&reporttimesubmitbutton=Update&manual_run=1&hideoptions=1&username=nagiosadmin&ticket=4ttb5cj8&locale=en_US' as '/usr/local/nagiosxi/tmp/scheduledreport-nagiosadmin-1441045666-page.pdf' ************
When I try to send a report via email, the PDF attachment is 0 bytes in length.

No output in /var/log/httpd/error_log

It seems like a supporting program/module must be missing, but I don't know what's required.

Chris
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: PDF reports not working

Post by tgriep »

Can you run the following and post the output here?

Code: Select all

wkhtmltopdf -V
which  wkhtmltopdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
nbdstl
Posts: 16
Joined: Fri Apr 24, 2015 9:11 am

Re: PDF reports not working

Post by nbdstl »

Code: Select all

[root@host ~]# wkhtmltopdf -V
wkhtmltopdf 0.12.1-c22928d (with patched qt)

[root@host ~]# which wkhtmltopdf
/usr/bin/wkhtmltopdf
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: PDF reports not working

Post by lmiltchev »

Are you using/forcing SSL? What is the output of the following commands?

Code: Select all

ifconfig
grep use_https /usr/local/nagiosxi/html/config.inc.php
cat /etc/hosts
ls -ld /usr/local/nagiosxi
ls -ld /usr/local/nagiosxi/tmp
Go to Admin->Manage System Config and show us what you have in the "Program URL" and "External URL" fields.
Be sure to check out our Knowledgebase for helpful articles and solutions!
nbdstl
Posts: 16
Joined: Fri Apr 24, 2015 9:11 am

Re: PDF reports not working

Post by nbdstl »

Code: Select all

[root@host ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.254.2  netmask 255.255.255.0  broadcast 192.168.254.255
        inet6 fe80::5054:ff:fe86:6030  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:86:60:30  txqueuelen 1000  (Ethernet)
        RX packets 19376017  bytes 8042258834 (7.4 GiB)
        RX errors 0  dropped 11032  overruns 0  frame 0
        TX packets 20601891  bytes 2643324030 (2.4 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 2841375  bytes 1331200813 (1.2 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2841375  bytes 1331200813 (1.2 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@host ~]# grep use_https /usr/local/nagiosxi/html/config.inc.php
$cfg['use_https'] = false; // determines whether cron jobs and other scripts will force the use of HTTPS instead of HTTP
[root@host ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@host ~]# ls -ld /usr/local/nagiosxi
drwxr-xr-x 10 nagios nagios 94 May 25 08:25 /usr/local/nagiosxi
[root@host ~]# ls -ld /usr/local/nagiosxi/tmp
drwsrwsr-x 2 apache nagios 4096 Aug 31 13:35 /usr/local/nagiosxi/tmp
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: PDF reports not working

Post by ssax »

Edit this file:

Code: Select all

/usr/local/nagiosxi/html/config.inc.php
Change this:

Code: Select all

$cfg['use_https'] = false;
To:

Code: Select all

$cfg['use_https'] = true;
Then try it again, usually when we see this it's related to a proxy, this might resolve it for you though.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: PDF reports not working

Post by tgriep »

We need to know how these settings are configured in XI.
Go to Admin->Manage System Config and show us what you have in the "Program URL" and "External URL" fields.
When the report are run, it uses the External URL to run them. If that URL is incorrect, they will not run.
Be sure to check out our Knowledgebase for helpful articles and solutions!
nbdstl
Posts: 16
Joined: Fri Apr 24, 2015 9:11 am

Re: PDF reports not working

Post by nbdstl »

I actually edited /etc/hosts and put the local hostname into the hosts file.

It works now.

Thanks!
Locked