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

Working on Zabbix7 and PHP 8.3? #40

Open amarodefarias opened 1 month ago

amarodefarias commented 1 month ago

I'm using Oracle Linux version 9.4 as my Operating System, version 7.0 of Zabbix with Nginx, which requires a PHP version higher than 8.0, in my case, I'm using 8.3.

In version 1.2.4 of your project, I can authenticate, all hosts appear in the list for selection and when continuing, a blank screen is displayed and the following error appears in /var/log/nginx/error.log: 2024/06/07 08:54:09 [error] 1284#1284: *65583 FastCGI sent in stderr: "PHP message: PHP Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /usr/share/zabbix/report/createpdf.php on line 64; PHP message: PHP Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in /usr/share/zabbix/report/createpdf.php on line 66; .php on line 69; PHP message: PHP Warning: Undefined variable $method in /usr/share/zabbix/report/inc/ZabbixAPI.class.php on line 252; /share/zabbix/report/inc/ZabbixAPI.class.php on line 252; PHP message: PHP Warning: Trying to access array offset on false in /usr/share/zabbix/report/inc/createpdf.functions.php on line 53; PHP message: PHP Warning: Trying to access array offset on false in /usr/share/zabbix/report/inc/createpdf.functions.php on line 53; /usr/share/zabbix/report/inc/createpdf.functions.php on line 53; PHP message: PHP Warning: Trying to access array offset on false in /usr/share/zabbix/report/inc/createpdf.functions.php on line 53; PHP message: PHP Warning: Trying to access array offset on false in /usr/share/zabbix/report/inc/createpdf.functions.php on line 53; PHP message: PHP Warning: Trying to access array offset on false in /usr/share/zabbix/report/inc/createpdf.functions.php on line 53; PHP message: PHP Warning: Trying to access array offset on false in /usr/share/zabbix/report/inc/createpdf.functions.php on line 53; PHP message: PHP Warning: Trying to access array offset on false in /usr/share/zabbix/report/inc/createpdf.functions.php on line 53; PHP message: PHP Warning: Trying to access array offset on false in /usr/share/zabbix/report/inc/createpdf.functions.php on line 53; PHP message: PHP Warning: Trying to access array offset on false in /usr/share/zabbix/report/inc/createpdf.functions.php on line 53; PHP mess

With version 1.2.5 of the project, in the hosts selection list the only one that appears is Zabbix Server. I select it, continue with the other parameters and the error in php is the same as previously reported.

It gives the impression that there is some PHP function in Deprecated mode

And now how to solve it?

martinm76 commented 3 weeks ago

My testsystem is now running 7.0.1 and PHP 8.1. I also only get the Zabbix server returned. Even removing any criteria other than sorting, I still only get the Zabbix server. From studying the API, I can't see a meaningful difference in the host.get implementation, so at the present moment I believe it to be a bug in the API.

martinm76 commented 3 weeks ago

Just tried an alternative API implementation from IntelliTrend. That one seems to work. I'll see if I can figure out what is different o r possibly switch to their API. That would likely require quite a few changes, though. https://github.com/intellitrend/zabbixapi-php

amarodefarias commented 2 weeks ago

Thanks for the feedback. I really wanted to change, but my knowledge is limited in this area. I hope that this way works and that we have an updated version as soon as possible. If you need someone for testing, I'm available.