Executive summary report to pdf/jpg broken

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
CBoekhuis
Posts: 234
Joined: Tue Aug 16, 2011 4:55 am

Executive summary report to pdf/jpg broken

Post by CBoekhuis »

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:
pdf_output.PNG
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 stat
Obviously de execsummary.php is located in:

Code: 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.php
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:

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
---
> }
Kind Regards,
Hans Blom
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Executive summary report to pdf/jpg broken

Post by lmiltchev »

The issue should be fixed in Nagios XI 5.4.6. Try upgrading your Nagios XI instance to see if this is going to fix the problem.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Executive summary report to pdf/jpg broken

Post by lmiltchev »

Update: Actually, I was wrong. The fix will be in 5.4.7. If you don't want to wait, here's a "workaround":

1. Make a backup of the original utils-reports-export.inc.php file just in case:

Code: Select all

cp -p /usr/local/nagiosxi/html/includes/utils-reports-export.inc.php /usr/local/nagiosxi/html/includes/utils-reports-export.inc.php.orig
2. Download the file below:
utils-reports-export.inc.php.zip
3. Unzip it and copy the utils-reports-export.inc.php file to /usr/local/nagiosxi/html/includes/ directory, overwriting the original file.

Let us know if this fixed the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
CBoekhuis
Posts: 234
Joined: Tue Aug 16, 2011 4:55 am

Re: Executive summary report to pdf/jpg broken

Post by CBoekhuis »

Thank you for the information lmiltchev. I don't see an attached file to download, but that is ok. I'm currently using the utils-reports-export.inc.php from the 5.4.4 version and that fixed the issue as well. Once 5.4.7 is released I'll give it another go.
dsilvero
Posts: 10
Joined: Tue Sep 01, 2015 9:40 am

Re: Executive summary report to pdf/jpg broken

Post by dsilvero »

Thanks you, it´s work !!!!

Regards

Diego
Locked