New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve PHP 8.1 support when adding devices #5483
Comments
Good catch. What happens if you edit global $banned_snmp_strings;
if ($string === null) {
return '';
} |
PHP8 deprecations drive me nuts. |
2023-09-08 13:13:43 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())2023-09-08 13:13:43 - ERROR PHP ERROR: Uncaught TypeError: dechex(): Argument #1 ($num) must be of type int, string given in /var/www/html/cacti/lib/data_query.php:1378 Stack trace: #0 /var/www/html/cacti/lib/data_query.php(1378): dechex() #1 /var/www/html/cacti/lib/data_query.php(106): query_snmp_host() #2 /var/www/html/cacti/lib/api_device.php(1289): run_data_query() #3 /var/www/html/cacti/lib/api_device.php(1131): api_device_update_host_template() #4 /var/www/html/cacti/host.php(286): api_device_save() #5 /var/www/html/cacti/host.php(62): form_save() #6 {main} thrown in file: /var/www/html/cacti/lib/data_query.php on line: 1378 |
I forgot to tell you what line to put that code block on. That's why is didn't work. |
Go to line 745, go up till you find the global again and paste there instead. You need to remove the first one you did too. |
thank you ! i will feedback after i test it . |
Download the lib/snmp.php from the 1.2.x branch. Should be fixed. |
2023-09-11 08:05:51 - CMDPHP PHP ERROR Backtrace: (CactiShutdownHandler())2023-09-11 08:05:51 - ERROR PHP ERROR: Uncaught TypeError: dechex(): Argument #1 ($num) must be of type int, string given in /var/www/html/cacti/lib/data_query.php:1378 Stack trace: #0 /var/www/html/cacti/lib/data_query.php(1378): dechex() #1 /var/www/html/cacti/lib/data_query.php(106): query_snmp_host() #2 /var/www/html/cacti/lib/api_device.php(1289): run_data_query() #3 /var/www/html/cacti/lib/api_device.php(1131): api_device_update_host_template() #4 /var/www/html/cacti/host.php(286): api_device_save() #5 /var/www/html/cacti/host.php(62): form_save() #6 {main} thrown in file: /var/www/html/cacti/lib/data_query.php on line: 1378 I have tested it and cannot solve the problem. add device page very very slow . |
This should get closer to a solution.
Okay, I've made another change. The reason it's slow is that your re-index is failing on one of the Data Queries as Cacti is attempting to re-index them and they are failing. Remove the broken Data Query from the Device Template until the issue is resolved. What is the Data Query? If you enable Data Source Trace, you will get some more metrics. Under |
the same code , same device , why in php 7.4 no problem ? |
It's more about PHP 8 I think. But I can not be certain as there are too many degree's of freedom. You you do stand alone and separate installs, and can show a distinct difference using the SNMP trace, the would be help. If you get the snmp community string wrong, or any of the Data Queries for the Device Template are invalid, the timeouts could be excessive and adding devices can be slowed too. |
add new device very very slow
After adding, it was found device status is unknown.
logpage show error message.
i test cacti in ubuntu 20.04.6 php7.4 is ok no this error .
The text was updated successfully, but these errors were encountered: