Page 2 of 2

Re: SLA PDF Reports not Generating Properly

Posted: Tue Jul 16, 2019 9:10 am
by lmiltchev
Can you try running your wget test from the CLI with and without the "--no-check-certificate" portion, and show the output, but this time wrapping the URL in quotes?

Re: SLA PDF Reports not Generating Properly

Posted: Tue Jul 16, 2019 11:16 pm
by MediaworksNZ
This is wget without the ignore-cert switch and tail of the log:

Code: Select all

[root@twnagios3 ~]# wget "https://localhost/nagiosxi/reports/sla.php?host=&showdetail=0&export=1&reportperiod=last24hours&startdate=&enddate=&service=&hostgroup=&servicegroup=&slalevel=95&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&token=7012401474facd9ef78e76b7bdea2348e922a732&locale=en_US&records=100000&mode=getreport&hideoptions=1&old_browser_compat=1"
--2019-07-17 16:04:40--  https://localhost/nagiosxi/reports/sla.php?host=&showdetail=0&export=1&reportperiod=last24hours&startdate=&enddate=&service=&hostgroup=&servicegroup=&slalevel=95&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&token=7012401474facd9ef78e76b7bdea2348e922a732&locale=en_US&records=100000&mode=getreport&hideoptions=1&old_browser_compat=1
Resolving localhost (localhost)... ::1, IPOFSERVER
Connecting to localhost (localhost)|::1|:443... connected.
ERROR: cannot verify localhost's certificate, issued by ‘/DC=removed/DC=removed/CN=Private-CA’:
  Unable to locally verify the issuer's authority.
ERROR: no certificate subject alternative name matches
        requested host name ‘localhost’.
To connect to localhost insecurely, use `--no-check-certificate'.
[root@twnagios3 ~]# tail -f /var/log/httpd/*error_log
==> /var/log/httpd/error_log <==
Length: 825 [text/html]
Saving to: '/usr/local/nagiosxi/tmp/scheduledreport-myusername-hTpFtKCBF93L-1563227539-SLA.pdf'

     0K                                                       100% 6.59M=0s

2019-07-16 09:52:20 (6.59 MB/s) - '/usr/local/nagiosxi/tmp/scheduledreport-myusername-hTpFtKCBF93L-1563227539-SLA.pdf' saved [825/825]

The switch --no-outline, is not support using unpatched qt, and will be ignored.The switch --footer-spacing, is not support using unpatched qt, and will be ignored.The switch --footer-font-size, is not support using unpatched qt, and will be ignored.The switch --footer-right, is not support using unpatched qt, and will be ignored.The switch --footer-left, is not support using unpatched qt, and will be ignored.wkhtmltopdf: cannot connect to X server
The switch --no-outline, is not support using unpatched qt, and will be ignored.The switch --footer-spacing, is not support using unpatched qt, and will be ignored.The switch --footer-font-size, is not support using unpatched qt, and will be ignored.The switch --footer-right, is not support using unpatched qt, and will be ignored.The switch --footer-left, is not support using unpatched qt, and will be ignored.wkhtmltopdf: cannot connect to X server
The switch --no-outline, is not support using unpatched qt, and will be ignored.The switch --footer-spacing, is not support using unpatched qt, and will be ignored.The switch --footer-font-size, is not support using unpatched qt, and will be ignored.The switch --footer-right, is not support using unpatched qt, and will be ignored.The switch --footer-left, is not support using unpatched qt, and will be ignored.wkhtmltopdf: cannot connect to X server

==> /var/log/httpd/ssl_error_log <==
[Wed Jul 17 13:02:47.629253 2019] [:error] [pid 48560] [client IP:50430] PHP Warning:  array_multisort(): Argument #1 is expected to be an array or a sort flag in /usr/local/nagiosxi/html/includes/utils-dashboards.inc.php on line 0, referer: https://twnagios3/nagiosxi/login.php
[Wed Jul 17 13:02:47.629273 2019] [:error] [pid 48560] [client IP:50430] PHP Notice:  Undefined variable: home in /usr/local/nagiosxi/html/includes/utils-dashboards.inc.php on line 0, referer: https://twnagios3/nagiosxi/login.php
[Wed Jul 17 13:02:47.632092 2019] [:error] [pid 48560] [client IP:50430] PHP Warning:  array_multisort(): Argument #1 is expected to be an array or a sort flag in /usr/local/nagiosxi/html/includes/utils-dashboards.inc.php on line 0, referer: https://twnagios3/nagiosxi/login.php
[Wed Jul 17 13:02:47.632479 2019] [:error] [pid 48560] [client IP:50430] PHP Warning:  array_multisort(): Argument #1 is expected to be an array or a sort flag in /usr/local/nagiosxi/html/includes/utils-dashboards.inc.php on line 0, referer: https://twnagios3/nagiosxi/login.php
[Wed Jul 17 15:53:54.854643 2019] [:error] [pid 48560] [client IP:56265] PHP Warning:  simplexml_load_string(): Entity: line 25: parser error : StartTag: invalid element name in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
[Wed Jul 17 15:53:54.854754 2019] [:error] [pid 48560] [client IP:56265] PHP Warning:  simplexml_load_string(): nagios[27854]: SERVICE ALERT: TWVOIPSUB1;CPU Usage;OK;SOFT;2;1 CPU, load 26.0% < in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
[Wed Jul 17 15:53:54.854781 2019] [:error] [pid 48560] [client IP:56265] PHP Warning:  simplexml_load_string():                                                                                ^ in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
[Wed Jul 17 15:53:54.951750 2019] [:error] [pid 76086] [client IP:56269] PHP Warning:  simplexml_load_string(): Entity: line 25: parser error : StartTag: invalid element name in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
[Wed Jul 17 15:53:54.951820 2019] [:error] [pid 76086] [client IP:56269] PHP Warning:  simplexml_load_string(): nagios[27854]: SERVICE ALERT: TWVOIPSUB1;CPU Usage;OK;SOFT;2;1 CPU, load 26.0% < in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
[Wed Jul 17 15:53:54.951842 2019] [:error] [pid 76086] [client IP:56269] PHP Warning:  simplexml_load_string():                                                                                ^ in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
This is wget with the ignore-cert switch and tail of the log:

Code: Select all

[root@twnagios3 ~]# wget --no-check-certificate "https://localhost/nagiosxi/reports/sla.php?host=&showdetail=0&export=1&reportperiod=last24hours&startdate=&enddate=&service=&hostgroup=&servicegroup=&slalevel=95&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&token=7012401474facd9ef78e76b7bdea2348e922a732&locale=en_US&records=100000&mode=getreport&hideoptions=1&old_browser_compat=1"
--2019-07-17 16:10:02--  https://localhost/nagiosxi/reports/sla.php?host=&showdetail=0&export=1&reportperiod=last24hours&startdate=&enddate=&service=&hostgroup=&servicegroup=&slalevel=95&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&token=7012401474facd9ef78e76b7bdea2348e922a732&locale=en_US&records=100000&mode=getreport&hideoptions=1&old_browser_compat=1
Resolving localhost (localhost)... ::1, IPOFSERVER
Connecting to localhost (localhost)|::1|:443... connected.
WARNING: cannot verify localhost's certificate, issued by ‘/DC=removed/DC=removed/CN=Private-CA’:
  Unable to locally verify the issuer's authority.
WARNING: no certificate subject alternative name matches
        requested host name ‘localhost’.
HTTP request sent, awaiting response... 200 OK
Length: 27 [text/html]
sla.php?host=&showdetail=0&export=1&reportperiod=last24hours&startdate=&enddate=&service=&hostgroup=&servicegroup=&slalevel=95&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&token=7012401474facd9ef78e76b7bdea2348e922a732&locale=en_US&records=100000&mode=getreport&hideoptions=1&old_browser_compat=1: File name too long

Cannot write to ‘sla.php?host=&showdetail=0&export=1&reportperiod=last24hours&startdate=&enddate=&service=&hostgroup=&servicegroup=&slalevel=95&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&token=7012401474facd9ef78e76b7bdea2348e922a732&locale=en_US&records=100000&mode=getreport&hideoptions=1&old_browser_compat=1’ (Success).
[root@twnagios3 ~]# tail -f /var/log/httpd/*error_log
==> /var/log/httpd/error_log <==
Length: 825 [text/html]
Saving to: '/usr/local/nagiosxi/tmp/scheduledreport-username-hTpFtKCBF93L-1563227539-SLA.pdf'

     0K                                                       100% 6.59M=0s

2019-07-16 09:52:20 (6.59 MB/s) - '/usr/local/nagiosxi/tmp/scheduledreport-username-hTpFtKCBF93L-1563227539-SLA.pdf' saved [825/825]

The switch --no-outline, is not support using unpatched qt, and will be ignored.The switch --footer-spacing, is not support using unpatched qt, and will be ignored.The switch --footer-font-size, is not support using unpatched qt, and will be ignored.The switch --footer-right, is not support using unpatched qt, and will be ignored.The switch --footer-left, is not support using unpatched qt, and will be ignored.wkhtmltopdf: cannot connect to X server
The switch --no-outline, is not support using unpatched qt, and will be ignored.The switch --footer-spacing, is not support using unpatched qt, and will be ignored.The switch --footer-font-size, is not support using unpatched qt, and will be ignored.The switch --footer-right, is not support using unpatched qt, and will be ignored.The switch --footer-left, is not support using unpatched qt, and will be ignored.wkhtmltopdf: cannot connect to X server
The switch --no-outline, is not support using unpatched qt, and will be ignored.The switch --footer-spacing, is not support using unpatched qt, and will be ignored.The switch --footer-font-size, is not support using unpatched qt, and will be ignored.The switch --footer-right, is not support using unpatched qt, and will be ignored.The switch --footer-left, is not support using unpatched qt, and will be ignored.wkhtmltopdf: cannot connect to X server

==> /var/log/httpd/ssl_error_log <==
[Wed Jul 17 13:02:47.629253 2019] [:error] [pid 48560] [client IP:50430] PHP Warning:  array_multisort(): Argument #1 is expected to be an array or a sort flag in /usr/local/nagiosxi/html/includes/utils-dashboards.inc.php on line 0, referer: https://twnagios3/nagiosxi/login.php
[Wed Jul 17 13:02:47.629273 2019] [:error] [pid 48560] [client IP:50430] PHP Notice:  Undefined variable: home in /usr/local/nagiosxi/html/includes/utils-dashboards.inc.php on line 0, referer: https://twnagios3/nagiosxi/login.php
[Wed Jul 17 13:02:47.632092 2019] [:error] [pid 48560] [client IP:50430] PHP Warning:  array_multisort(): Argument #1 is expected to be an array or a sort flag in /usr/local/nagiosxi/html/includes/utils-dashboards.inc.php on line 0, referer: https://twnagios3/nagiosxi/login.php
[Wed Jul 17 13:02:47.632479 2019] [:error] [pid 48560] [client IP:50430] PHP Warning:  array_multisort(): Argument #1 is expected to be an array or a sort flag in /usr/local/nagiosxi/html/includes/utils-dashboards.inc.php on line 0, referer: https://twnagios3/nagiosxi/login.php
[Wed Jul 17 15:53:54.854643 2019] [:error] [pid 48560] [client IP:56265] PHP Warning:  simplexml_load_string(): Entity: line 25: parser error : StartTag: invalid element name in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
[Wed Jul 17 15:53:54.854754 2019] [:error] [pid 48560] [client IP:56265] PHP Warning:  simplexml_load_string(): nagios[27854]: SERVICE ALERT: TWVOIPSUB1;CPU Usage;OK;SOFT;2;1 CPU, load 26.0% < in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
[Wed Jul 17 15:53:54.854781 2019] [:error] [pid 48560] [client IP:56265] PHP Warning:  simplexml_load_string():                                                                                ^ in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
[Wed Jul 17 15:53:54.951750 2019] [:error] [pid 76086] [client IP:56269] PHP Warning:  simplexml_load_string(): Entity: line 25: parser error : StartTag: invalid element name in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
[Wed Jul 17 15:53:54.951820 2019] [:error] [pid 76086] [client IP:56269] PHP Warning:  simplexml_load_string(): nagios[27854]: SERVICE ALERT: TWVOIPSUB1;CPU Usage;OK;SOFT;2;1 CPU, load 26.0% < in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/
[Wed Jul 17 15:53:54.951842 2019] [:error] [pid 76086] [client IP:56269] PHP Warning:  simplexml_load_string():                                                                                ^ in /usr/local/nagiosxi/html/includes/utils-systat.inc.php on line 17, referer: https://twnagios3.domain.forest/nagiosxi/reports/

Re: SLA PDF Reports not Generating Properly

Posted: Wed Jul 17, 2019 4:49 pm
by tgriep
Can you login to the server as root, run the following command and post the output?

Code: Select all

wkhtmltopdf -V
yum list installed |grep -i wkhtmltopdf
When a report is created, it uses the localhost entry to create the file and it looks like you changed the setting for localhost.

Lets put is back by editing the /etc/hosts entry and change this line from

Code: Select all

IPofServer   localhost localhost.localdomain localhost4 localhost4.localdomain4 twnagios3 twnagios3.domain.forest
to

Code: Select all

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
Then add this to the bottom.

Code: Select all

IPofServer twnagios3 twnagios3.domain.forest

Another thing, it looks like the wkhtmltopdf package may not be the patched version XI users to generate the pdf files so remove the current version and run the following to install the patched version.

Code: Select all

cd /tmp
rm -rf nagiosxi xi*.tar.gz
wget https://assets.nagios.com/downloads/nagiosxi/5/xi-5.6.3.tar.gz
tar xzf xi-5.6.3.tar.gz
cd /tmp/nagiosxi/subcomponents/wkhtmltox
./install
Let us know how it works out.

Re: SLA PDF Reports not Generating Properly

Posted: Thu Jul 18, 2019 9:01 pm
by MediaworksNZ
Right,

Here is the information requested.
Can you login to the server as root, run the following command and post the output?
wkhtmltopdf -V
yum list installed |grep -i wkhtmltopdf

Code: Select all

[root]# wkhtmltopdf -V
wkhtmltopdf 0.12.1.3 (with patched qt)
[root]# yum list installed |grep -i wkhtmltopdf
wkhtmltopdf.x86_64                 0.12.1-1.el7                   @epel
I change the hosts file back.

Code: Select all

127.0.0.1      localhost localhost.localdomain localhost4 localhost4.localdomain4
::1            localhost localhost.localdomain localhost6 localhost6.localdomain6
IPOFSERVER   twnagios3 twnagios3.domain.forest
Tested, but issue was still there.

Removed the installed version:

Code: Select all

yum remove wkhtmltopdf
Downloaded and Extracted the XI version i have installed: xi-5.6.5.tar.gz.
When I try to install the subcomponent I get the following error:

Code: Select all

[root@twnagios3 tmp]# cd nagiosxi/subcomponents/wkhtmltox/
[root@twnagios3 wkhtmltox]# ./install
INSTALL: wkhtmltox is being installed...
--2019-07-19 14:21:41--  https://assets.nagios.com/downloads/nagiosxi/packages/wkhtmltox-0.12.1.3.el5.x86_64.rpm
Resolving assets.nagios.com (assets.nagios.com)... 72.14.181.71, 2600:3c00::f03c:91ff:fedf:b821
Connecting to assets.nagios.com (assets.nagios.com)|72.14.181.71|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://assets.nagios.com/redirects/redirect.php?url=https://assets.nagios.com/downloads/nagiosxi/packages/wkhtmltox-0.12.1.3.el5.x86_64.rpm [following]
--2019-07-19 14:21:42--  https://assets.nagios.com/redirects/redirect.php?url=https://assets.nagios.com/downloads/nagiosxi/packages/wkhtmltox-0.12.1.3.el5.x86_64.rpm
Reusing existing connection to assets.nagios.com:443.
HTTP request sent, awaiting response... 404 Not Found
2019-07-19 14:21:42 ERROR 404: Not Found.
I tried in a web browser and got the same error.

Thanks

Re: SLA PDF Reports not Generating Properly

Posted: Fri Jul 19, 2019 8:53 am
by tgriep
Does the server have access to the internet?

Run the following as root and post the output here.

Code: Select all

uname -a
cat /etc/*release*
Thanks

Re: SLA PDF Reports not Generating Properly

Posted: Sun Jul 21, 2019 8:31 pm
by MediaworksNZ
Hi,

Yes the server does have internet access.

Have you at least tried accessing that URL to confirm that there is no issue on your end as this error strongly hints at?
https://assets.nagios.com/downloads/nag ... x86_64.rpm

I have tried on another internet connection where there is no internet restrictions applied and I get the same error "404 not found" which is why I cannot download/install the "wkhtmltox-0.12.1.3.el5.x86_64.rpm" package as per your previous post to this one.

If you can't confirm the URL, can you at least attach it to this thread so that I can get it installed?

Here is the output as requested.

Code: Select all

[manager@twnagios3 ~]$ uname -a
Linux twnagios3.domain.forest 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[manager@twnagios3 ~]$ cat /etc/*release*
CentOS Linux release 7.6.1810 (Core)
Derived from Red Hat Enterprise Linux 7.6 (Source)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.6.1810 (Core)
CentOS Linux release 7.6.1810 (Core)
cpe:/o:centos:centos:7
I need some traction on this as my manager wants this server in production and reports sent out.

Thanks.

Re: SLA PDF Reports not Generating Properly

Posted: Mon Jul 22, 2019 7:09 am
by scottwilkerson
There is one step missing in there, sorry about that

Code: Select all

cd /tmp/nagiosxi
./init.sh
cd nagiosxi/subcomponents/wkhtmltox/
./install

Re: SLA PDF Reports not Generating Properly

Posted: Mon Jul 22, 2019 5:22 pm
by MediaworksNZ
Excellent.

I see the link now works.
I have installed the rpm file and reports are now being generated fine.

Thank you for your help.
It is much appreciated.

Code: Select all

[root@twnagios3 wkhtmltox]# ./install
INSTALL: wkhtmltox is being installed...
--2019-07-23 10:12:00--  https://assets.nagios.com/downloads/nagiosxi/packages/wkhtmltox-0.12.1.3.el7.x86_64.rpm
Resolving assets.nagios.com (assets.nagios.com)... 72.14.181.71, 2600:3c00::f03c:91ff:fedf:b821
Connecting to assets.nagios.com (assets.nagios.com)|72.14.181.71|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14094280 (13M) [application/x-rpm]
Saving to: ‘wkhtmltox-0.12.1.3.el7.x86_64.rpm’

100%[===================================================================================================================================================================================================>] 14,094,280   962KB/s   in 15s

2019-07-23 10:12:16 (935 KB/s) - ‘wkhtmltox-0.12.1.3.el7.x86_64.rpm’ saved [14094280/14094280]

Loaded plugins: fastestmirror
Examining wkhtmltox-0.12.1.3.el7.x86_64.rpm: 1:wkhtmltox-0.12.1.3-1~centos7.x86_64
wkhtmltox-0.12.1.3.el7.x86_64.rpm: does not update installed package.
Nothing to do
INSTALL: wkhtmltox installed OK.

Re: SLA PDF Reports not Generating Properly

Posted: Tue Jul 23, 2019 6:34 am
by scottwilkerson
MediaworksNZ wrote:Excellent.

I see the link now works.
I have installed the rpm file and reports are now being generated fine.

Thank you for your help.
It is much appreciated.

Code: Select all

[root@twnagios3 wkhtmltox]# ./install
INSTALL: wkhtmltox is being installed...
--2019-07-23 10:12:00--  https://assets.nagios.com/downloads/nagiosxi/packages/wkhtmltox-0.12.1.3.el7.x86_64.rpm
Resolving assets.nagios.com (assets.nagios.com)... 72.14.181.71, 2600:3c00::f03c:91ff:fedf:b821
Connecting to assets.nagios.com (assets.nagios.com)|72.14.181.71|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14094280 (13M) [application/x-rpm]
Saving to: ‘wkhtmltox-0.12.1.3.el7.x86_64.rpm’

100%[===================================================================================================================================================================================================>] 14,094,280   962KB/s   in 15s

2019-07-23 10:12:16 (935 KB/s) - ‘wkhtmltox-0.12.1.3.el7.x86_64.rpm’ saved [14094280/14094280]

Loaded plugins: fastestmirror
Examining wkhtmltox-0.12.1.3.el7.x86_64.rpm: 1:wkhtmltox-0.12.1.3-1~centos7.x86_64
wkhtmltox-0.12.1.3.el7.x86_64.rpm: does not update installed package.
Nothing to do
INSTALL: wkhtmltox installed OK.
Great!

Locking