martinm76 / zabbix-pdf-report

Reporting tool in PHP for the Zabbix Monitoring Platform. Rather versatile reporting on hosts and host groups.
https://www.zabbix.com/forum/zabbix-cookbook/25368-zabbix-dynamic-pdf-report-generation?filter_time=time_lastmonth
GNU General Public License v3.0
52 stars 55 forks source link

Report without graps #23

Closed krzysztof-sz closed 4 months ago

krzysztof-sz commented 3 years ago

Graphs are not displayed for me. It works ok but the graphs are empty.

[root@vm-Zabbix inc]# nginx -v
nginx version: nginx/1.14.1
[root@vm-Zabbix inc]# rpm -qa | grep php
php-xml-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64
php-ldap-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64
php-common-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64
php-json-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64
php-mysqlnd-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64
php-fpm-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64
php-bcmath-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64
php-pdo-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64
php-mbstring-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64
php-gd-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64

Below is the nginx log: I changed in log host and address ip zabbix on zabbix-ip.

[root@vm-Zabbix inc]# tail /var/log/nginx/error.log PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320" while reading response header from upstream, client: 10.0.91.78, server: example.com, request: "GET /zabbix-pdf-report/createpdf.php?ReportType=host&HostID=10329&GraphsOn=yes&ItemsOn=yes&mygraphs2=%23%28System+local+time%7CPing%7CCPU+load%7CCPU+usage%7CCPU+util%7Cprocessor%7CDisk+space%7CSwap%7CEthernet%7CMemory+usage%7C%5ETraffic+on+%7Ctraffic+on+eth%29%23&myitems2=%23%28System+local+time%7CUtilization+of%7Cfarm+connection%7CAverage+Latency%7CNumber+of+processes%7CCache+%25+Hit%29%23&ReportRange=last&timePeriod=Day HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/zabbix.sock:", host: "zabbix-ip", referrer: "http://zabbix-ip/zabbix-pdf-report/chooser.php" 2021/03/24 12:41:19 [error] 943#0: *150908 FastCGI sent in stderr: "PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320" while reading response header from upstream, client: 10.0.91.78, server: example.com, request: "GET /zabbix-pdf-report/createpdf.php?ReportType=host&HostID=10329&GraphsOn=yes&mygraphs2=%23%28MSSQL%3A+Auto-params%29%23&myitems2=%23%28System+local+time%7CUtilization+of%7Cfarm+connection%7CAverage+Latency%7CNumber+of+processes%7CCache+%25+Hit%29%23&ReportRange=last&timePeriod=Day HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/zabbix.sock:", host: "zabbix-ip", referrer: "http://zabbix-ip/zabbix-pdf-report/chooser.php" 2021/03/24 12:43:02 [error] 943#0: *150908 FastCGI sent in stderr: "PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320" while reading response header from upstream, client: 10.0.91.78, server: example.com, request: "GET /zabbix-pdf-report/createpdf.php?ReportType=host&HostID=10329&GraphsOn=yes&mygraphs2=%23%28MSSQL%3A+Auto-params%29%23&myitems2=%23%28System+local+time%7CUtilization+of%7Cfarm+connection%7CAverage+Latency%7CNumber+of+processes%7CCache+%25+Hit%29%23&ReportRange=last&timePeriod=Day HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/zabbix.sock:", host: "zabbix-ip", referrer: "http://zabbix-ip/zabbix-pdf-report/chooser.php" [root@vm-Zabbix inc]#

[root@vm-Zabbix zabbix-pdf-report]#  ./fixrights.sh
drwxrwxrwx 2 apache root 62 Mar 24 10:29 reports
drwxrwxrwx 3 apache root 61 Mar 24 13:07 tmp

SELinux seems to be installed. We will try to fix context. It may not be enough ...
chcon: can't apply partial context to unlabeled file 'branches'
chcon: can't apply partial context to unlabeled file 'description'
chcon: can't apply partial context to unlabeled file 'applypatch-msg.sample'
chcon: can't apply partial context to unlabeled file 'commit-msg.sample'
chcon: can't apply partial context to unlabeled file 'post-update.sample'
chcon: can't apply partial context to unlabeled file 'pre-applypatch.sample'
chcon: can't apply partial context to unlabeled file 'pre-commit.sample'
chcon: can't apply partial context to unlabeled file 'pre-merge-commit.sample'
chcon: can't apply partial context to unlabeled file 'pre-push.sample'
chcon: can't apply partial context to unlabeled file 'pre-receive.sample'
chcon: can't apply partial context to unlabeled file 'update.sample'
chcon: can't apply partial context to unlabeled file 'fsmonitor-watchman.sample'
chcon: can't apply partial context to unlabeled file 'pre-rebase.sample'
chcon: can't apply partial context to unlabeled file 'prepare-commit-msg.sample'
chcon: can't apply partial context to unlabeled file 'hooks'
chcon: can't apply partial context to unlabeled file 'exclude'
chcon: can't apply partial context to unlabeled file 'info'
chcon: can't apply partial context to unlabeled file 'master'
chcon: can't apply partial context to unlabeled file 'heads'
chcon: can't apply partial context to unlabeled file 'tags'
chcon: can't apply partial context to unlabeled file 'HEAD'
chcon: can't apply partial context to unlabeled file 'origin'
chcon: can't apply partial context to unlabeled file 'remotes'
chcon: can't apply partial context to unlabeled file 'refs'
chcon: can't apply partial context to unlabeled file 'HEAD'
chcon: can't apply partial context to unlabeled file 'config'
chcon: can't apply partial context to unlabeled file 'pack-abfd6c3f80e85cc4b8cb067bf47e4ccb92a4d7d1.pack'
chcon: can't apply partial context to unlabeled file 'pack-abfd6c3f80e85cc4b8cb067bf47e4ccb92a4d7d1.idx'
chcon: can't apply partial context to unlabeled file 'pack'
chcon: can't apply partial context to unlabeled file 'info'
chcon: can't apply partial context to unlabeled file 'objects'
chcon: can't apply partial context to unlabeled file 'packed-refs'
chcon: can't apply partial context to unlabeled file 'HEAD'
chcon: can't apply partial context to unlabeled file 'origin'
chcon: can't apply partial context to unlabeled file 'remotes'
chcon: can't apply partial context to unlabeled file 'master'
chcon: can't apply partial context to unlabeled file 'heads'
chcon: can't apply partial context to unlabeled file 'refs'
chcon: can't apply partial context to unlabeled file 'HEAD'
chcon: can't apply partial context to unlabeled file 'logs'
chcon: can't apply partial context to unlabeled file 'index'
chcon: can't apply partial context to unlabeled file '.git'
chcon: can't apply partial context to unlabeled file 'Changelog'
chcon: can't apply partial context to unlabeled file 'LICENSE'
chcon: can't apply partial context to unlabeled file 'README.md'
chcon: can't apply partial context to unlabeled file 'chooser.php'
chcon: can't apply partial context to unlabeled file 'config.inc.php.dist'
chcon: can't apply partial context to unlabeled file 'createpdf.php'
chcon: can't apply partial context to unlabeled file 'core.css'
chcon: can't apply partial context to unlabeled file 'jquery.datetimepicker.css'
chcon: can't apply partial context to unlabeled file 'reset.css'
chcon: can't apply partial context to unlabeled file 'select2.css'
chcon: can't apply partial context to unlabeled file 'tablesorter.css'
chcon: can't apply partial context to unlabeled file 'zabbix.color.css'
chcon: can't apply partial context to unlabeled file 'zabbix.default.css'
chcon: can't apply partial context to unlabeled file 'zabbix.report.css'
chcon: can't apply partial context to unlabeled file 'css'
chcon: can't apply partial context to unlabeled file 'fixrights.sh'
chcon: can't apply partial context to unlabeled file 'AvantGardeConBol.afm'
chcon: can't apply partial context to unlabeled file 'AvantGardeGothicBook.afm'
chcon: can't apply partial context to unlabeled file 'AvantGardeGothicDemi.afm'
chcon: can't apply partial context to unlabeled file 'Courier-Bold.afm'
chcon: can't apply partial context to unlabeled file 'Courier-BoldOblique.afm'
chcon: can't apply partial context to unlabeled file 'Courier-Oblique.afm'
chcon: can't apply partial context to unlabeled file 'Courier.afm'
chcon: can't apply partial context to unlabeled file 'Helvetica-Bold.afm'
chcon: can't apply partial context to unlabeled file 'Helvetica-BoldOblique.afm'
chcon: can't apply partial context to unlabeled file 'Helvetica-Oblique.afm'
chcon: can't apply partial context to unlabeled file 'Helvetica.afm'
chcon: can't apply partial context to unlabeled file 'Symbol.afm'
chcon: can't apply partial context to unlabeled file 'Times-Bold.afm'
chcon: can't apply partial context to unlabeled file 'Times-BoldItalic.afm'
chcon: can't apply partial context to unlabeled file 'Times-Italic.afm'
chcon: can't apply partial context to unlabeled file 'Times-Roman.afm'
chcon: can't apply partial context to unlabeled file 'ZapfDingbats.afm'
chcon: can't apply partial context to unlabeled file 'php_Courier-Bold.afm'
chcon: can't apply partial context to unlabeled file 'php_Courier-BoldOblique.afm'
chcon: can't apply partial context to unlabeled file 'php_Courier-Oblique.afm'
chcon: can't apply partial context to unlabeled file 'php_Courier.afm'
chcon: can't apply partial context to unlabeled file 'php_Helvetica-Bold.afm'
chcon: can't apply partial context to unlabeled file 'php_Helvetica-BoldOblique.afm'
chcon: can't apply partial context to unlabeled file 'php_Helvetica-Oblique.afm'
chcon: can't apply partial context to unlabeled file 'php_Helvetica.afm'
chcon: can't apply partial context to unlabeled file 'php_Symbol.afm'
chcon: can't apply partial context to unlabeled file 'php_Times-Bold.afm'
chcon: can't apply partial context to unlabeled file 'php_Times-BoldItalic.afm'
chcon: can't apply partial context to unlabeled file 'php_Times-Italic.afm'
chcon: can't apply partial context to unlabeled file 'php_Times-Roman.afm'
chcon: can't apply partial context to unlabeled file 'php_ZapfDingbats.afm'
chcon: can't apply partial context to unlabeled file 'php_a0100131.afm'
chcon: can't apply partial context to unlabeled file 'php_a010013l.afm'
chcon: can't apply partial context to unlabeled file 'fonts'
chcon: can't apply partial context to unlabeled file 'asc.gif'
chcon: can't apply partial context to unlabeled file 'bg.gif'
chcon: can't apply partial context to unlabeled file 'desc.gif'
chcon: can't apply partial context to unlabeled file 'zabbix.png'
chcon: can't apply partial context to unlabeled file 'general'
chcon: can't apply partial context to unlabeled file 'select2-spinner.gif'
chcon: can't apply partial context to unlabeled file 'select2.png'
chcon: can't apply partial context to unlabeled file 'select2x2.png'
chcon: can't apply partial context to unlabeled file 'zabbix_logo.png'
chcon: can't apply partial context to unlabeled file 'images'
chcon: can't apply partial context to unlabeled file 'ZabbixAPI.class.php'
chcon: can't apply partial context to unlabeled file 'class.ezpdf.php'
chcon: can't apply partial context to unlabeled file 'class.pdf.php'
chcon: can't apply partial context to unlabeled file 'createpdf.functions.php'
chcon: can't apply partial context to unlabeled file 'index.functions.php'
chcon: can't apply partial context to unlabeled file 'pdf.functions.php'
chcon: can't apply partial context to unlabeled file 'inc'
chcon: can't apply partial context to unlabeled file 'index.php'
chcon: can't apply partial context to unlabeled file 'jquery.datetimepicker.css'
chcon: can't apply partial context to unlabeled file 'jquery.datetimepicker.js'
chcon: can't apply partial context to unlabeled file 'jquery.js'
chcon: can't apply partial context to unlabeled file 'jquery.tablesorter.min.js'
chcon: can't apply partial context to unlabeled file 'jquery.validate.min.js'
chcon: can't apply partial context to unlabeled file 'select2.min.js'
chcon: can't apply partial context to unlabeled file '.gitignore'
chcon: can't apply partial context to unlabeled file 'MIT-LICENSE.txt'
chcon: can't apply partial context to unlabeled file 'README.md'
chcon: can't apply partial context to unlabeled file 'bower.json'
chcon: can't apply partial context to unlabeled file 'jquery.datetimepicker.full.js'
chcon: can't apply partial context to unlabeled file 'jquery.datetimepicker.full.min.js'
chcon: can't apply partial context to unlabeled file 'jquery.datetimepicker.min.js'
chcon: can't apply partial context to unlabeled file 'build'
chcon: can't apply partial context to unlabeled file 'datetimepicker.jquery.json'
chcon: can't apply partial context to unlabeled file 'doc.tpl'
chcon: can't apply partial context to unlabeled file 'index.html'
chcon: can't apply partial context to unlabeled file 'jquery.datetimepicker.css'
chcon: can't apply partial context to unlabeled file 'jquery.datetimepicker.js'
chcon: can't apply partial context to unlabeled file 'jquery.datetimepicker.min.js'
chcon: can't apply partial context to unlabeled file 'jquery.js'
chcon: can't apply partial context to unlabeled file 'package.json'
chcon: can't apply partial context to unlabeled file '1.png'
chcon: can't apply partial context to unlabeled file '2.png'
chcon: can't apply partial context to unlabeled file '3.1.png'
chcon: can't apply partial context to unlabeled file '3.png'
chcon: can't apply partial context to unlabeled file '4.png'
chcon: can't apply partial context to unlabeled file '5.png'
chcon: can't apply partial context to unlabeled file '6.png'
chcon: can't apply partial context to unlabeled file 'screen'
chcon: can't apply partial context to unlabeled file 'datetimepicker-master'
chcon: can't apply partial context to unlabeled file 'master.zip'
chcon: can't apply partial context to unlabeled file 'zip'
chcon: can't apply partial context to unlabeled file 'js'
chcon: can't apply partial context to unlabeled file 'logout.php'
chcon: can't apply partial context to unlabeled file 'report-rename.php'
chcon: can't apply partial context to unlabeled file 'zabbix_report_hritJo'
chcon: can't apply partial context to unlabeled file 'zabbix_reportphzivi'
chcon: can't apply partial context to unlabeled file 'tmp'
chcon: can't apply partial context to unlabeled file 'hyper-v.pdf'
chcon: can't apply partial context to unlabeled file 'gbbl01.pdf'
chcon: can't apply partial context to unlabeled file 'pomos04.pdf'
chcon: can't apply partial context to unlabeled file 'reports'
chcon: can't apply partial context to unlabeled file 'config.inc.php'
chcon: can't apply partial context to unlabeled file '/usr/share/zabbix/zabbix-pdf-report'
chcon: can't apply partial context to unlabeled file 'hyper-v.pdf'
chcon: can't apply partial context to unlabeled file 'gbbl01.pdf'
chcon: can't apply partial context to unlabeled file 'pomos04.pdf'
chcon: can't apply partial context to unlabeled file '/usr/share/zabbix/zabbix-pdf-report/reports'
chcon: can't apply partial context to unlabeled file 'zabbix_report_hritJo'
chcon: can't apply partial context to unlabeled file 'zabbix_reportphzivi'
chcon: can't apply partial context to unlabeled file '/usr/share/zabbix/zabbix-pdf-report/tmp'
martinm76 commented 2 years ago

My guess is that nginx is not running as the apache user and you need to make a change to adapt to that. There may be a SELinux boolean for nginx that needs to be set as well. Not sure.

cojedareu commented 2 years ago

y en apache como soluciono ese problema

martinm76 commented 2 years ago

Are the graphs written correctly? I believe the temporary files are usually deleted when the report is done, so you will probably need to comment out that bit to verify.

From the looks of this, the most likely cause is either not being able to access the file, the file being corrupt (or perhaps 0 bytes, which in a manner of speaking is corrupt). Verify that the temp directory is writable by the process nginx is running as.

On Wed, 24 Mar 2021 at 12:56, krzysztof-sz @.***> wrote:

Graphs are not displayed for me. It works ok but the graphs are empty. Below is the nginx log:

@. inc]# nginx -v nginx version: nginx/1.14.1 @. inc]# rpm -qa | grep php php-xml-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 php-ldap-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 php-common-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 php-json-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 php-mysqlnd-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 php-fpm-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 php-bcmath-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 php-pdo-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 php-mbstring-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 php-gd-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64

I changed in log host and address ip zabbix on zabbix-ip.

@. inc]# tail /var/log/nginx/error.log PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320 PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320" while reading response header from upstream, client: 10.0.91.78, server: example.com, request: "GET /zabbix-pdf-report/createpdf.php?ReportType=host&HostID=10329&GraphsOn=yes&ItemsOn=yes&mygraphs2=%23%28System+local+time%7CPing%7CCPU+load%7CCPU+usage%7CCPU+util%7Cprocessor%7CDisk+space%7CSwap%7CEthernet%7CMemory+usage%7C%5ETraffic+on+%7Ctraffic+on+eth%29%23&myitems2=%23%28System+local+time%7CUtilization+of%7Cfarm+connection%7CAverage+Latency%7CNumber+of+processes%7CCache+%25+Hit%29%23&ReportRange=last&timePeriod=Day HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/zabbix.sock:", host: "zabbix-ip", referrer: "http://zabbix-ip/zabbix-pdf-report/chooser.php" 2021/03/24 12:41:19 [error] 943#0: 150908 FastCGI sent in stderr: "PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320" while reading response header from upstream, client: 10.0.91.78, server: example.com, request: "GET /zabbix-pdf-report/createpdf.php?ReportType=host&HostID=10329&GraphsOn=yes&mygraphs2=%23%28MSSQL%3A+Auto-params%29%23&myitems2=%23%28System+local+time%7CUtilization+of%7Cfarm+connection%7CAverage+Latency%7CNumber+of+processes%7CCache+%25+Hit%29%23&ReportRange=last&timePeriod=Day HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/zabbix.sock:", host: "zabbix-ip", referrer: "http://zabbix-ip/zabbix-pdf-report/chooser.php" 2021/03/24 12:43:02 [error] 943#0: 150908 FastCGI sent in stderr: "PHP message: PHP Notice: getimagesize(): Read error! in /usr/share/zabbix/zabbix-pdf-report/inc/class.ezpdf.php on line 1320" while reading response header from upstream, client: 10.0.91.78, server: example.com, request: "GET /zabbix-pdf-report/createpdf.php?ReportType=host&HostID=10329&GraphsOn=yes&mygraphs2=%23%28MSSQL%3A+Auto-params%29%23&myitems2=%23%28System+local+time%7CUtilization+of%7Cfarm+connection%7CAverage+Latency%7CNumber+of+processes%7CCache+%25+Hit%29%23&ReportRange=last&timePeriod=Day HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/zabbix.sock:", host: "zabbix-ip", referrer: "http://zabbix-ip/zabbix-pdf-report/chooser.php" @. inc]#

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/martinm76/zabbix-pdf-report/issues/23, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACWMJDUYMKL225776M4UXG3TFHHQRANCNFSM4ZXDN5WQ .

-- Venlig hilsen/Best Regards,

/Martin Møller

martinm76 commented 4 months ago

Again, missing further input to fix the issue for nearly two years. Closing this.