Page 3 of 3

Re: emailed report pdfs corrupted

Posted: Fri Aug 11, 2017 2:50 pm
by tgriep
The attachments are created on the fly so there is not a copy left on the server. If they were, they would be empty.
I did file a bug fix for this and to reference it, you would use this ID number 12337.

Re: emailed report pdfs corrupted

Posted: Fri Aug 11, 2017 3:04 pm
by jomann
ks6764 wrote:As I think I mentioned previously, the attachment is zero bytes. Even if I change it to a text extension and attempt to open it, it has absolutely nothing in it, no messages, nothing at all.
I just reran the report to email it to myself again and captured the following from the error_log. I changed the hostname and IP address below for security reasons.

Code: Select all

--2017-08-10 11:52:09--  https://myfullyqualfied.server.name/nagiosxi//reports/execsummary.php?reportperiod=last24hours&startdate=&enddate=&host=&service=&hostgroup=&servicegroup=&advanced=0&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringdowntime=yes&includesoftstates=no&assumedhoststate=3&assumedservicestate=6&timeperiod=&locale=en_US&mode=pdf

Resolving myfullyqualfied.server.name (fullyqualfied.server.name)... 123.456.xxx.xxx

Connecting to myfullyqualfied.server.name (myfullyqualfied.server.name)|123.456.xxx.xxx|:443... connected.

OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Unable to establish SSL connection.
As for your question about a proxy server. Under the Admin/System Config/Proxy Configuration link I do have a proxy listed there which was needed to allow me to run the "Check for Updates" button located under the "Manage Components" section.
What you posted above is what needs to be able to be grabbed from the internal code. On a cron, it runs a command that does this:

Code: Select all

wget --no-check-certificate -O <filename> '<url>'
Where the url is the URL you provided above. Are you able to use the above URL in wget in your command line?

Re: emailed report pdfs corrupted

Posted: Fri Aug 11, 2017 3:39 pm
by ks6764
We ran the following as a test.

Code: Select all

/usr/bin/wkhtmltopdf --footer-spacing 3 --margin-bottom 15mm --footer-font-size 9 --footer-right "Page [page] of [toPage]" --footer-left "2017-08-11 15:17:56" --header-left "test" 'https://ourserver/nagiosxi//reports/availability.php?&username=ourid&ticket=pSm4YsRcvGWbMG9qXvQcsdI5JT2BCA42JKlXcd90SlrU2Dkf8qrTGpeGigdUPAcO&locale=en_US' '/usr/local/nagiosxi/tmp/scheduledreport-ourid-PMqqsP-test.pdf'
The above should be configurable so that we can include port number 8443 in the https line.
We ran the above manually like follows:

Code: Select all

/usr/bin/wkhtmltopdf --footer-spacing 3 --margin-bottom 15mm --footer-font-size 9 --footer-right "Page [page] of [toPage]" --footer-left "2017-08-11 15:17:56" --header-left "test" '">https://blph952.bhdc.>;
/usr/bin/wkhtmltopdf --footer-spacing 3 --margin-bottom 15mm --footer-font-size 9 --footer-right "Page [page] of [toPage]" --footer-left "2017-08-11 15:17:56" --header-left "test" 'https://ourserver:8443/nagiosxi//reports/availability.php?&username=ourid&ticket=pSm4YsRcvGWbMG9qXvQcsdI5JT2BCA42JKlXcd90SlrU2Dkf8qrTGpeGigdUPAcO&locale=en_US' '/usr/local/nagiosxi/tmp/scheduledreport-ourid-PMqqsP-test.pdf'
Note in the above how we included the port, when running the above we got the following output which would create the pdf. Without the port, the pdf ended up empty.

Loading pages (1/6)
Warning: SSL error ignored
Warning: SSL error ignored
Warning: SSL error ignored
Warning: SSL error ignored
Warning: SSL error ignored
Warning: SSL error ignored
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done

So I will be looking forward to the bug fix on this. Any ETA as to when we can expect a fix ? Our executives like the reporting function, but also want us to be using https/SSL and following company guidelines of course by using the 8443 port.

Thx.

Re: emailed report pdfs corrupted

Posted: Mon Aug 14, 2017 11:25 am
by tgriep
Sorry, there is not an ETA on when this will be fixed as the schedule is changing but hopefully the next release will include it.