Page 3 of 4

Re: Unable to generate PDF or JPG reports

Posted: Thu Oct 15, 2015 1:26 pm
by tgriep
Can you schedule the report and have it email to you and post the pdf file here if it is corrupted?
Can you run the following commands on your Nagios system and post the output?

Code: Select all

nslookup 192.168.136.46
nslookup kinnag
nslookup kinnag.tegnet.co.uk
ip addr

Re: Unable to generate PDF or JPG reports

Posted: Mon Oct 19, 2015 5:07 am
by mcleodc
I have attached the attachment from the scheduled report. I needed to change the extension from .pdf to .txt to allow the upload.

[root@kinnag ~]#
[root@kinnag ~]# nslookup 192.168.136.46
Server: 192.168.136.189
Address: 192.168.136.189#53

46.136.168.192.in-addr.arpa name = kinnag.tegnet.co.uk.

[root@kinnag ~]# nslookup kinnag
Server: 192.168.136.189
Address: 192.168.136.189#53

Name: kinnag.tegnet.co.uk
Address: 192.168.136.46

[root@kinnag ~]# nslookup kinnag.tegnet.co.uk
Server: 192.168.136.189
Address: 192.168.136.189#53

Name: kinnag.tegnet.co.uk
Address: 192.168.136.46

[root@kinnag ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:50:56:96:4a:31 brd ff:ff:ff:ff:ff:ff
inet 192.168.136.46/22 brd 192.168.139.255 scope global eth0
inet6 fe80::250:56ff:fe96:4a31/64 scope link
valid_lft forever preferred_lft forever
3: sit0: <NOARP> mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0
[root@kinnag ~]#

Re: Unable to generate PDF or JPG reports

Posted: Mon Oct 19, 2015 1:24 pm
by tgriep
Can you run the following and post the results?

Code: Select all

ls -l /usr/local/nagiosxi/html/reports/
ls -l /usr/local/nagiosxi/html/
service iptables status
Thanks

Re: Unable to generate PDF or JPG reports

Posted: Tue Oct 20, 2015 4:46 am
by mcleodc
[root@kinnag ~]# ls -l /usr/local/nagiosxi/html/reports/
total 972
-rwxr-x--- 1 nagios nagios 193420 Oct 12 12:53 alertheatmap.php
-rwxr-x--- 1 nagios nagios 109958 Oct 12 12:53 availability.php
-rw-r----- 1 nagios nagios 12551 Mar 15 2012 capacityplanning.php
-rw-r----- 1 nagios nagios 580 Apr 27 11:31 createpdf.php
-rwxr-x--- 1 nagios nagios 29895 Oct 12 12:53 eventlog.php
-rw-r----- 1 nagios nagios 33353 Oct 12 12:53 execsummary.php
-rwxr-x--- 1 nagios nagios 36308 Oct 12 12:53 histogram.php
-rw-r----- 1 nagios nagios 3453 Oct 12 12:53 hmtest.php
-rwxr-x--- 1 nagios nagios 2177 Oct 12 12:53 index.php
-rwxr-x--- 1 nagios nagios 656 Oct 12 12:53 main.php
-rwxr-x--- 1 nagios nagios 8054 Oct 12 12:53 myreports.php
-rwxr-x--- 1 nagios nagios 2556 Oct 12 12:53 nagioscorereports.php
-rwxr-x--- 1 nagios nagios 3133 Oct 12 12:53 nagiosxireports.php
-rwxr-x--- 1 nagios nagios 42220 Oct 12 12:53 notifications.php
-rw-r----- 1 nagios nagios 365516 Oct 12 12:53 sla.php
-rwxr-x--- 1 nagios nagios 53194 Oct 12 12:53 statehistory.php
-rwxr-x--- 1 nagios nagios 35583 Oct 12 12:53 topalertproducers.php
[root@kinnag ~]# ls -l /usr/local/nagiosxi/html/
total 464
drwxr-x--- 2 nagios nagios 4096 Jan 11 2010 about
drwxr-x--- 2 nagios nagios 4096 Jul 3 2013 account
drwxr-x--- 2 nagios nagios 4096 Jan 11 2010 addons
drwxr-x--- 2 nagios nagios 4096 Aug 29 2012 admin
-rwxr-x--- 1 nagios nagios 27107 Oct 12 12:53 ajaxhelper.php
-rwxr-x--- 1 nagios nagios 1705 Oct 12 12:53 ajaxproxy.php
drwxr-x--- 4 nagios nagios 4096 Oct 5 17:13 api
drwxr-x--- 3 nagios nagios 4096 Jan 11 2010 backend
drwxr-x--- 3 nagios nagios 4096 Oct 5 17:13 config
-rwxr-x--- 1 nagios nagios 5147 Oct 12 12:54 config.inc.dist
-rwxr-x--- 1 nagios nagios 5147 Oct 12 12:54 config.inc.php
-rwxr-x--- 1 nagios nagios 5147 Oct 12 12:53 config.inc.saved
drwxr-x--- 2 nagios nagios 4096 Oct 5 17:13 dashboards
drwxr-x--- 4 nagios nagios 4096 Jan 11 2010 db
drwxr-x--- 3 nagios nagios 4096 Jan 11 2010 downloads
drwxr-x--- 2 nagios nagios 4096 Oct 5 17:13 help
drwxr-x--- 4 nagios nagios 12288 Oct 5 17:13 images
-rw-r----- 1 nagios nagios 23844 Jun 9 2010 inag.php
drwxr-x--- 12 nagios nagios 4096 Oct 5 17:13 includes
-rwxr-x--- 1 nagios nagios 929 Oct 12 12:53 index.php
-rwxr-x--- 1 nagios nagios 10089 Oct 12 12:53 install.php
-rwxr-x--- 1 nagios nagios 155916 Oct 12 12:54 login.php
-rw-r----- 1 nagios nagios 2303 Oct 12 12:54 loginsplash.inc.dist
-rw-r----- 1 nagios nagios 2212 Oct 12 12:54 loginsplash.inc.php
-rw-r----- 1 nagios nagios 2212 Oct 12 12:53 loginsplash.inc.saved
drwxr-x--- 2 nagios nagios 4096 Jan 11 2010 perfgraphs
drwxr-x--- 2 nagios nagios 4096 May 14 2014 reports
-rw-r----- 1 nagios nagios 19861 Oct 12 12:54 rr.php
-rwxr-x--- 1 nagios nagios 12253 Oct 12 12:54 suggest.php
drwxr-x--- 2 nagios nagios 4096 Dec 20 2011 tools
-rwxr-x--- 1 nagios nagios 1979 Oct 12 12:53 upgrade.php
drwxr-x--- 2 nagios nagios 4096 Oct 5 17:13 views
[root@kinnag ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:162
2 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:162
3 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:10000

Chain FORWARD (policy ACCEPT)
num target prot opt source destination

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

Table: mangle
Chain PREROUTING (policy ACCEPT)
num target prot opt source destination

Chain INPUT (policy ACCEPT)
num target prot opt source destination

Chain FORWARD (policy ACCEPT)
num target prot opt source destination

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

Chain POSTROUTING (policy ACCEPT)
num target prot opt source destination

Table: nat
Chain PREROUTING (policy ACCEPT)
num target prot opt source destination

Chain POSTROUTING (policy ACCEPT)
num target prot opt source destination

Chain OUTPUT (policy ACCEPT)
num target prot opt source destination

Re: Unable to generate PDF or JPG reports

Posted: Tue Oct 20, 2015 2:02 pm
by lmiltchev
Hm-m, I don't see port 80 or port 443 in your firewall rules... Did you edit the output before posting it?
Can you temporarily stop the iptables to see if this is going to fix your issue?

Re: Unable to generate PDF or JPG reports

Posted: Mon Oct 26, 2015 5:59 am
by mcleodc
i have the same issue with iptables stopped. Could it have been stopped all along?

Re: Unable to generate PDF or JPG reports

Posted: Mon Oct 26, 2015 1:48 pm
by tgriep
Can you run the following in a shell and post back the output?

Code: Select all

wkhtmltopdf -V                                                                                                                                                                                     
which wkhtmltopdf
Not that the hosts file has been edited, can you put the Program URL in the Admin > Systems Settings back to

Code: Select all

http://kinnag.tegnet.co.uk/nagiosxi/
Save it out and lets restart the Nagios and Apache processes and then see if the report is generated.

Code: Select all

service nagios restart
service httpd restart

Re: Unable to generate PDF or JPG reports

Posted: Tue Oct 27, 2015 3:37 am
by mcleodc
still the same issue after doing what you said.

Last login: Mon Oct 26 10:48:49 2015 from kin5356.tegnet.co.uk
[root@kinnag ~]# wkhtmltopdf -V
Name:
wkhtmltopdf 0.10.0 rc2

License:
Copyright (C) 2010 wkhtmltopdf/wkhtmltoimage Authors.



License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO
WARRANTY, to the extent permitted by law.

Authors:
Written by Jan Habermann, Christian Sciberras and Jakob Truelsen. Patches by
Mehdi Abbad, Lyes Amazouz, Pascal Bach, Emmanuel Bouthenot, Benoit Garret and
Mário Silva.

[root@kinnag ~]# which wkhtmltopdf
/usr/bin/wkhtmltopdf
[root@kinnag ~]# service nagios restart
service httpd restartRunning configuration check...
Stopping nagios:. done.
Starting nagios: done.
You have new mail in /var/spool/mail/root
[root@kinnag ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.136.46 for ServerName
[ OK ]
[root@kinnag ~]#

Re: Unable to generate PDF or JPG reports

Posted: Tue Oct 27, 2015 2:22 pm
by lmiltchev
[root@kinnag ~]# wkhtmltopdf -V
Name:
wkhtmltopdf 0.10.0 rc2
It seems that you are running an older version of "wkhtmltopdf". You should be running "0.12.1". If you kept the original install directory, try running:

Code: Select all

cd /tmp/nagiosxi/subcomponents/wkhtmlx
./install
Check to see if the version of wkhtmltopdf got updated:

Code: Select all

wkhtmltopdf -V
Did this resolve your issue?

Re: Unable to generate PDF or JPG reports

Posted: Wed Oct 28, 2015 4:55 am
by mcleodc
That sorted it! many thanks for your help.