Executive summary report to pdf/jpg broken
Posted: Mon Jul 03, 2017 6:21 am
Hello,
When I run the execuive summary report with pdf as output, an error is generated instead of the report. The report is correctly generated in the browser, but download as pdf has stopped working.
Currently running on Nagios XI 5.4.5, CentOS release 6.8
PDF output: Notice the double '//', as if there's an empty string.
Apache error_log shows following message:
Obviously de execsummary.php is located in:
After digging around in the code, I restored the previous version of /usr/local/nagiosxi/html/includes/utils-reports-export.inc.php from our backup.
The executive summary is now correctly generated to pdf (and also to jpg, also had the same problem).
a diff of the 2 utils-reports-export.inc.php files will show the following:
Kind Regards,
Hans Blom
When I run the execuive summary report with pdf as output, an error is generated instead of the report. The report is correctly generated in the browser, but download as pdf has stopped working.
Currently running on Nagios XI 5.4.5, CentOS release 6.8
PDF output: Notice the double '//', as if there's an empty string.
Apache error_log shows following message:
Code: Select all
[Mon Jul 03 13:06:19 2017] [error] [client 192.168.116.50] script '/usr/local/nagiosxi/html/execsummary.php' not found or unable to statCode: Select all
find /usr/local/nagiosxi/ -name execsummary.php -ls
1860159 36 -rw-r----- 1 nagios nagios 34310 Jun 14 10:42 /usr/local/nagiosxi/html/reports/execsummary.phpThe executive summary is now correctly generated to pdf (and also to jpg, also had the same problem).
a diff of the 2 utils-reports-export.inc.php files will show the following:
Code: Select all
diff utils-reports-export.inc.php utils-reports-export.inc.php.5.4.5
4c4
< // Copyright (c) 2015 Nagios Enterprises, LLC. All rights reserved.
---
> // Copyright (c) 2015-2017 Nagios Enterprises, LLC. All rights reserved.
15,17c15,18
< * @param string $reportname The name of the report file (i.e. 'availability')
< * @param constant $type Msut be EXPORT_PDF (default) or EXPORT_JPG
< * @param constant $orientation Can be either EXPORT_PORTRAIT (default) or EXPORT_LANDSCAPE
---
> * @param string $reportname The name of the report file (i.e. 'availability')
> * @param constant $type Msut be EXPORT_PDF (default) or EXPORT_JPG
> * @param constant $orientation Can be either EXPORT_PORTRAIT (default) or EXPORT_LANDSCAPE
> * @param sring $report_location Used to override the folder in which the $reportname .php resides
21c22
< function export_report($reportname, $type = EXPORT_PDF, $orientation = EXPORT_PORTRAIT)
---
> function export_report($reportname, $type = EXPORT_PDF, $orientation = EXPORT_PORTRAIT, $report_location = null)
73,74d73
< $report_location = 'reports';
<
81a81,84
> } else {
> if ($report_location == null) {
> $report_location = 'reports';
> }
105c108
< }
\ No newline at end of file
---
> }Hans Blom