Giter VIP home page Giter VIP logo

Comments (15)

asalz-zh avatar asalz-zh commented on July 22, 2024

I'm also having this issue of empty graph data.

Tooling around in the files, I see that all the images in the tmp folder are of size 0.

Zabbix version: 5.0.5
Centos 8

from zabbix-pdf-report.

martinm76 avatar martinm76 commented on July 22, 2024

Have you run the fix-rights.sh script? Have you tried 'setenforce 0' so SELinux won't put roadblocks up, if there are issues?
Are the files put below the webroot folder or somewhere else? Are the SELinux contexts matching the Apache webserver (or whatever webserver you are using)?

Also note that is some cases, certain intervals produce graphs with no data in Zabbix as well, so please make sure that is not the case here.

from zabbix-pdf-report.

asalz-zh avatar asalz-zh commented on July 22, 2024

I have run the fix-rights script and I can't set setenforce 0 because its not found. The graphs don't show up no matter how large the interval i make it.

[root@appliance ~]# setenforce 0
-bash: setenforce: command not found
[root@appliance ~]# sestatus
-bash: sestatus: command not found
[root@appliance ~]# uname -a
Linux appliance 4.18.0-193.19.1.el8_2.x86_64 #1 SMP Mon Sep 14 14:37:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[root@appliance ~]# cat /etc/*-release
CentOS Linux release 8.2.2004 (Core)
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"

CentOS Linux release 8.2.2004 (Core)
CentOS Linux release 8.2.2004 (Core)

from zabbix-pdf-report.

Sillmael avatar Sillmael commented on July 22, 2024

Hi,
I have a similar issu : I can generate report, but no graph are shown, only titles.
I have no image in the "tmp" folder.
setenforce 0 : Command 'setenforce' not found

The debug looks like OK :

HostID: 10164
Report Type: host
Time Period: 2678400
Temp image path: /usr/share/zabbix/zabbix-pdf-report-master/tmp/zabbix_report_wuOfu3

Time scope - starttime: 1606039633, endtime: 1608718033 - stime: 20201122110713
Proxy Bompard(id:10164)
Graph selector : #.*#

CPU jumps (id:950) matched the expression - including it.
Array
(
    [graphid] => 950
    [name] => CPU jumps
)
[...]
./images/general/zabbix.png written to PDF-file ...
Report ready - available as: ./reports/proxy-bompard.pdf

When i run the fixrihts.sh, i have an error (maybe it's because i use nginx) :

sudo bash /usr/share/zabbix/zabbix-pdf-report-master/fixrights.sh
chown: invalid user: ‘apache’
drwxrwxrwx 2 root root 4096 Dec 23 12:55 reports
drwxrwxrwx 2 root root 4096 Dec 23 12:55 tmp

You should now have tmp and reports folders that your webserver can write to.

Zabbix-server: 5.0.6
Nginx 1.14.0
OS: Ubuntu 18.04

from zabbix-pdf-report.

asalz-zh avatar asalz-zh commented on July 22, 2024

@Sillmael @WW-build
Did either of you ever find a solution to this?

from zabbix-pdf-report.

martinm76 avatar martinm76 commented on July 22, 2024

This seems very odd. Could it be that there has been some update to your PHP libraries and possible some of the functions involved in making the images are no longer part of the base package and needs exstra modules?

Try to check phpinfo() output for if 'gd' is actually used?

On my Ubuntu test server, I could get this ouput with php7.2 -i -- I expect you have something similar.
Also, I would expect some error messages from PHP either in error log of webserver, messages or similar syslog location - unless somehow all errors have been suppressed in your PHP installation.

from zabbix-pdf-report.

asalz-zh avatar asalz-zh commented on July 22, 2024

Screen Shot 2021-02-24 at 11 18 05 AM

There is a screenshot of the phpinfo() for gd.

Here is the only php error.log file entry

2021/02/24 11:17:11 [error] 1289421#0: *1262 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 10.212.134.17, server: shared-zabbix.<REDACTEDDOMAIN>.com, request: "GET /zabbix-pdf-report/phpinfo.php HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/zabbix.sock:", host: "10.1.5.20"
2021/02/24 11:18:48 [error] 1289421#0: *1262 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
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.212.134.17, server: shared-zabbix.<REDACTEDDOMAIN>.com, request: "GET /zabbix-pdf-report/createpdf.php?ReportType=host&HostID=10335&GraphsOn=yes&mygraphs2=%23%28Ping%7CCPU+load%7CCPU+usage%7CCPU+util%7Cprocessor%7CDisk+space%7CSwap%7CEthernet%7CMemory+usage%7C%5ETraffic+on+%7Ctraffic+on+eth%29%23&myitems2=%23%28Utilization+of%7Cfarm+connection%7CAverage+Latency%7CNumber+of+processes%7CCache+%25+Hit%29%23&ReportRange=last&timePeriod=Hour HTTP/2.0", upstream: "fastcgi://unix:/run/php-fpm/zabbix.sock:", host: "10.1.5.20", referrer: "https://10.1.5.20/zabbix-pdf-report/chooser.php"

/var/log/nginx/error.log (END)

from zabbix-pdf-report.

martinm76 avatar martinm76 commented on July 22, 2024

Hmm... A couple of searches mention that it could be fopen being disabled in your settings, probably just for URL's, though.
It seems like the EzImage function opens the image/image data with an URL and tries to save it locally and then check it's type.
Since your files are always 0 bytes, it seems the stream isn't making it, so it might be that fopen on URL's is not allowed in the setup you have.

There are a few spots in createpdf.php where you could try to make sure temporary files are kept after the report is created

There's this for the text-file that ends up becoming the PDF:
unlink($tmp_pdf_data);

At the bottom there's this:
// Clean up temp images
array_map('unlink', glob("$z_tmpimg_path/*"));
rmdir("$z_tmpimg_path");

Experiment a bit with that and check your PHP settings.

from zabbix-pdf-report.

martinm76 avatar martinm76 commented on July 22, 2024

Just checked my test server, and I have this:

apache2/php.ini:allow_url_fopen = On

from zabbix-pdf-report.

asalz-zh avatar asalz-zh commented on July 22, 2024

I've got url_fopen on in the php settings
image

I've commented out the "clean up" section and it leaves the temp folder with empty picture files.

Is there a way to make a curl call manually of how it is supposed to be getting the graphs?

from zabbix-pdf-report.

martinm76 avatar martinm76 commented on July 22, 2024

Odd.. You could try to do some print statements or similar in the section with the fopen og GetImageSize call.
As for Curl, you might want to try something like this:
https://gist.github.com/BugBuster1701/7571132

from zabbix-pdf-report.

neter-bg avatar neter-bg commented on July 22, 2024

This can happen if you have an HTTPS connection to Zabbix, but the URL to Zabbix (variable $z_server) in config.inc.php of zabbix-pdf-report doesn't point to the domain which is written as Common Name (CN) in the server certificate. A self-signed certificate is not a problem, but a wrong domain is a problem.

from zabbix-pdf-report.

martinm76 avatar martinm76 commented on July 22, 2024

Anyone got an update on this issue? I have only run on either http or Let's Encrypt certificates, so @neter-bg may well have a point here. I almost always leave the host as localhost in my config. I have very limited experience with nginx.

A copy of config.inc.php with any needed redactions (but explanations of the redaction if so) would probably help, as well as a 'ls -la' from the directory the report is installed in.

from zabbix-pdf-report.

bitmind avatar bitmind commented on July 22, 2024

Hi everyone,
I've run into the same issue.

It looks like the problem sits in function GetGraphImageById(), during the first curl call, which should login to zabbix frontend and save authentication cookies.

It seems to be somehow related to HTTPS: if I configure a plain HTTP url in the z_server config variable, the function works and graphs are retrieved.

My environment: RockyLinux 8.6, PHP 7.2, Apache, Zabbix 6.0.

from zabbix-pdf-report.

andrebatista2031 avatar andrebatista2031 commented on July 22, 2024

Hey guys.
Has anyone managed to solve this problem and could you share the steps they took here?
In my case, even though I set the variable to http, as the URL all requests are in HTTPS, I believe it is not having any effect.

from zabbix-pdf-report.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.