SLA PDF Reports not Generating Properly
-
MediaworksNZ
- Posts: 29
- Joined: Tue Aug 05, 2014 5:22 pm
SLA PDF Reports not Generating Properly
Hi,
I have NagiosXi Installed and working.
The issue i'm having is when SLA reports are generated into a PDF and emailed, the PDF is 1KB in size.
This is for all users.
Can you advise what logs can be monitored to try a find out what is causing this?
I can see that wkhtmltox.x86_64 is installed and marked in red.
Thank you for your help.
Craig
I have NagiosXi Installed and working.
The issue i'm having is when SLA reports are generated into a PDF and emailed, the PDF is 1KB in size.
This is for all users.
Can you advise what logs can be monitored to try a find out what is causing this?
I can see that wkhtmltox.x86_64 is installed and marked in red.
Thank you for your help.
Craig
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: SLA PDF Reports not Generating Properly
Hi Craig,
Can you PM or attach the failed report to the post. Next, tail the Apache log file and then download a PDF of the SLA report your are generating. Open up a terminal on the Nagios server and run the following command:
generate the report and upload the output.
Lastly, please PM your system profile for us to review. Thanks.
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
Save the profile.zip file and share in a private message or upload it to the post/ticket.
Can you PM or attach the failed report to the post. Next, tail the Apache log file and then download a PDF of the SLA report your are generating. Open up a terminal on the Nagios server and run the following command:
Code: Select all
tail -f /var/log/httpd/*error_log
Lastly, please PM your system profile for us to review. Thanks.
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
Save the profile.zip file and share in a private message or upload it to the post/ticket.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
MediaworksNZ
- Posts: 29
- Joined: Tue Aug 05, 2014 5:22 pm
Re: SLA PDF Reports not Generating Properly
Hi Benjamin,
I have messaged you with the details.
Thanks
I have messaged you with the details.
Thanks
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: SLA PDF Reports not Generating Properly
Hi Craig,
Thanks for sending those files over. You getting a session timed out message in the report, so while the report is generating, the data is not being populated.
Please follow the instructions on the link below to optimize the PHP settings on your server, and then test the SLA report again.
Nagios XI - Optimizing The PHP Settings File
Thanks for sending those files over. You getting a session timed out message in the report, so while the report is generating, the data is not being populated.
Please follow the instructions on the link below to optimize the PHP settings on your server, and then test the SLA report again.
Nagios XI - Optimizing The PHP Settings File
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
MediaworksNZ
- Posts: 29
- Joined: Tue Aug 05, 2014 5:22 pm
Re: SLA PDF Reports not Generating Properly
Hi Benjamin,
Right, I am using the Modern Dark Theme.
The Theme is not showing errors on the screen when the text itself is black.
I happened to highlight the blank page and I saw the below text being selected.
Not sure why it is trying to resolve to the localhost name instead of the FQDN.
The Program URL in the System settings are correct and not pointing to localhost.
Right, I am using the Modern Dark Theme.
The Theme is not showing errors on the screen when the text itself is black.
I happened to highlight the blank page and I saw the below text being selected.
Code: Select all
Failed to create PDF
Verify that your Nagios XI server can connect to the URL:
http://localhost/nagiosxi/reports/sla.php?host=&showdetail=0&export=1&reportperiod=last24hours&startdate=&enddate=&service=&hostgroup=&servicegroup=&slalevel=99.99&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&token=dc95657242d47af31a9704a24c9f91a3882b3925&locale=en_US&records=100000&mode=getreport&hideoptions=1&old_browser_compat=1The Program URL in the System settings are correct and not pointing to localhost.
Re: SLA PDF Reports not Generating Properly
What you are describing is a bug that was fixed a long time ago - in Nagios XI 5.5.5 (task_id=13619). I am not sure why it's not working on your system. I haven't been able to recreate the issue in-house. Can you run the following command and show the output?
Code: Select all
ls -la /usr/local/nagiosxi/html/reports/sla.phpCan you go to Admin > System Settings and show a screenshot of the page?Not sure why it is trying to resolve to the localhost name instead of the FQDN.
The Program URL in the System settings are correct and not pointing to localhost.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
MediaworksNZ
- Posts: 29
- Joined: Tue Aug 05, 2014 5:22 pm
Re: SLA PDF Reports not Generating Properly
Hi.
Please find details below as requested.
[root@twnagios3 ~]# ls -la /usr/local/nagiosxi/html/reports/sla.php
-rw-r--r--. 1 nagios nagios 623833 Jun 18 16:59 /usr/local/nagiosxi/html/reports/sla.php
Here is the screen capture
Please find details below as requested.
[root@twnagios3 ~]# ls -la /usr/local/nagiosxi/html/reports/sla.php
-rw-r--r--. 1 nagios nagios 623833 Jun 18 16:59 /usr/local/nagiosxi/html/reports/sla.php
Here is the screen capture
You do not have the required permissions to view the files attached to this post.
Re: SLA PDF Reports not Generating Properly
Check to see if you have "localhost" in /etc/hosts:
Also, I can see that you are using https in the Program URL. Is SSL set up in config.inc.php as well?
Code: Select all
cat /etc/hostsCode: Select all
grep use_https /usr/local/nagiosxi/html/config.inc.phpBe sure to check out our Knowledgebase for helpful articles and solutions!
-
MediaworksNZ
- Posts: 29
- Joined: Tue Aug 05, 2014 5:22 pm
Re: SLA PDF Reports not Generating Properly
Hi,
Please find details of hosts file:
Output of config.inc.php
Please find details of hosts file:
Code: Select all
IPofServer localhost localhost.localdomain localhost4 localhost4.localdomain4 twnagios3 twnagios3.domain.forest
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 twnagios3 twnagios3.domain.forest
Code: Select all
grep use_https /usr/local/nagiosxi/html/config.inc.php
$cfg['use_https'] = true; // determines whether cron jobs and other scripts will force the use of HTTPS instead of HTTP
-
MediaworksNZ
- Posts: 29
- Joined: Tue Aug 05, 2014 5:22 pm
Re: SLA PDF Reports not Generating Properly
Also, when I use wget on the server:
When I try to download the report when using the GUI:
When submitting the URL via cli:
Then I submit the same command and instruct to ignore certificate error
It seems to get further but creates a file called: 27b Jul 16 09:42 sla.php?host=
Tail of Error Log:
When I try to download the report when using the GUI:
Code: Select all
Failed to create PDF
Verify that your Nagios XI server can connect to the URL:
https://localhost/nagiosxi/reports/sla.php?host=&showdetail=0&export=1&reportperiod=last24hours&startdate=&enddate=&service=&hostgroup=&servicegroup=&slalevel=99.99&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&token=38f1eec73d3954fd21bb1d5cfbd51b4d67229c78&locale=en_US&records=100000&mode=getreport&hideoptions=1&old_browser_compat=1Code: Select all
wget https://localhost/nagiosxi/reports/sla.php?host=&showdetail=0&export=1&reportperiod=last24hours&startdate=&enddate=&service=&hostgroup=&servicegroup=&slalevel=99.99&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&token=38f1eec73d3954fd21bb1d5cfbd51b4d67229c78&locale=en_US&records=100000&mode=getreport&hideoptions=1&old_browser_compat=1
[1] 76376
[2] 76377
[3] 76378
[4] 76379
[5] 76380
[6] 76381
[7] 76382
[8] 76383
[9] 76384
[10] 76385
[11] 76386
[12] 76387
[13] 76388
[14] 76389
[15] 76390
[16] 76391
[17] 76392
[18] 76393
[19] 76394
[20] 76395
[21] 76396
[22] 76397
[23] 76398
[2] Done showdetail=0
[3] Done export=1
[4] Done reportperiod=last24hours
[6] Done enddate=
[8] Done hostgroup=
[9] Done servicegroup=
[10] Done slalevel=99.99
[12] Done assumeinitialstates=yes
[13] Done assumestateretention=yes
[14] Done assumestatesduringdowntime=yes
[16] Done assumedhoststate=3
[17] Done assumedservicestate=6
[18] Done timeperiod=
[19] Done token=38f1eec73d3954fd21bb1d5cfbd51b4d67229c78
[21] Done records=100000
[root@twnagios3 ~]# --2019-07-16 09:35:24-- https://localhost/nagiosxi/reports/sla.php?host=
Resolving localhost (localhost)... ::1, IPofSERVER
Connecting to localhost (localhost)|::1|:443... connected.
ERROR: cannot verify localhost's certificate, issued by ‘/DC=**/DC=**/CN=**-CA’: (** = commented out)
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'.It seems to get further but creates a file called: 27b Jul 16 09:42 sla.php?host=
Code: Select all
wget --no-check-certificate https://localhost/nagiosxi/reports/sla.php?host=&showdetail=0&export=1&reportperiod=last24hours&startdate=&enddate=&service=&hostgroup=&servicegroup=&slalevel=99.99&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&token=38f1eec73d3954fd21bb1d5cfbd51b4d67229c78&locale=en_US&records=100000&mode=getreport&hideoptions=1&old_browser_compat=1
[1] 82782
[2] 82783
[3] 82784
[4] 82785
[5] 82786
[6] 82787
[7] 82788
[8] 82789
[9] 82790
[10] 82791
[11] 82792
[12] 82793
[13] 82794
[14] 82795
[15] 82796
[16] 82797
[17] 82798
[18] 82799
[19] 82800
[20] 82801
[21] 82802
[22] 82803
[23] 82804
[2] Done showdetail=0
[3] Done export=1
[4] Done reportperiod=last24hours
[5] Done startdate=
[6] Done enddate=
[7] Done service=
[8] Done hostgroup=
[9] Done servicegroup=
[10] Done slalevel=99.99
[11] Done advanced=0
[12] Done assumeinitialstates=yes
[13] Done assumestateretention=yes
[14] Done assumestatesduringdowntime=yes
[15] Done includesoftstates=no
[16] Done assumedhoststate=3
[17] Done assumedservicestate=6
[18] Done timeperiod=
[19] Done token=38f1eec73d3954fd21bb1d5cfbd51b4d67229c78
[20] Done locale=en_US
[21] Done records=100000
[22]- Done mode=getreport
[root@twnagios3 ~]# --2019-07-16 09:42:17-- https://localhost/nagiosxi/reports/sla.php?host=
Resolving localhost (localhost)... ::1, 10.21.250.94
Connecting to localhost (localhost)|::1|:443... connected.
WARNING: cannot verify localhost's certificate, issued by ‘/DC=forest/DC=domain/CN=MediaWorks-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]
Saving to: ‘sla.php?host=’
100%[===================================================================================================================================================================================================>] 27 --.-K/s in 0s
2019-07-16 09:42:17 (667 KB/s) - ‘sla.php?host=’ saved [27/27]
[1]- Done wget --no-check-certificate https://localhost/nagiosxi/reports/sla.php?host=
[23]+ Done hideoptions=1
Tail of Error Log:
Code: Select all
tail -f /var/log/httpd/*error_log
==> /var/log/httpd/error_log <==
HTTP request sent, awaiting response... wkhtmltoimage: cannot connect to X server
200 OK
Length: 828 [text/html]
Saving to: '/usr/local/nagiosxi/tmp/scheduledreport-username-ClMKnEmClT5W-1563225669-SLA.jpg'
0K 100% 17.9M=0s
2019-07-16 09:21:10 (17.9 MB/s) - '/usr/local/nagiosxi/tmp/scheduledreport-username-ClMKnEmClT5W-1563225669-SLA.jpg' saved [828/828]
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 <==
--2019-07-16 09:52:19-- https://twnagios3.domain.forest/nagiosxi//reports/sla.php?host=&showdetail=0&export=0&reportperiod=last24hours&startdate=&enddate=&host=&service=&hostgroup=&servicegroup=&slalevel=95&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&locale=en_US&mode=pdf&token=9c509cb9d174e739f0a4a6ea2cd1baebe95453bb
Resolving twnagios3.domain.forest (twnagios3.domain.forest)... ::1, 10.21.250.94
Connecting to twnagios3.domain.forest (twnagios3.domain.forest)|::1|:443... connected.
WARNING: cannot verify twnagios3.domain.forest's certificate, issued by '/DC=forest/DC=domain/CN=MediaWorks-CA':
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 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
200 OK
Length: 825 [text/html]
Saving to: '/usr/local/nagiosxi/tmp/scheduledreport-craigconnoll-hTpFtKCBF93L-1563227539-SLA.pdf'
0K 100% 6.59M=0s
2019-07-16 09:52:20 (6.59 MB/s) - '/usr/local/nagiosxi/tmp/scheduledreport-craigconnoll-hTpFtKCBF93L-1563227539-SLA.pdf' saved [825/825]