Cacti / plugin_syslog

Syslog Plugin for Cacti
GNU General Public License v2.0
21 stars 16 forks source link

PHP 8.1 Backtrace error in Cacti 1.2.22 #189

Closed sosrobert closed 2 years ago

sosrobert commented 2 years ago

Hello!

We have the following problem and we have no idea how to solve it. We've been suffering with it for a few days now, but we haven't come up with anything. We tried to navigate through the .php files but were unsuccessful. We would like to ask for help. We would be very grateful if anyone could help.

Best regards, Robi!

Plugin:

Desktop:

TheWitness commented 2 years ago

Oh fun. Thanks for letting us know.

TheWitness commented 2 years ago

Can you please update to the develop version and see first if that fixes it. You may have to modify your config.php (the one in syslog) if you are using a server other than the Cacti server.

sosrobert commented 2 years ago

Should we upgrade PHP to a developer version?

TheWitness commented 2 years ago

It's not PHP, download it from GitHub:

git clone https://github.com/cacti/plugin_syslog.git

Then copy the contents of plugin_syslog to your syslog directory.

sosrobert commented 2 years ago

The problem still exists. Updated the syslog as you said. Now it throws other errors.

- 2022-08-26 11:40:02 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/syslog/syslog_process.php[143]:syslog_traditional_manage(), /plugins/syslog/functions.php[157]:CactiErrorHandler())

- 2022-08-26 11:40:02 - ERROR PHP WARNING in Plugin 'syslog': Undefined variable $retention in file: /var/www/html/cacti/plugins/syslog/functions.php on line: 157

- 2022-08-26 11:40:02 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/syslog/syslog_process.php[143]:syslog_traditional_manage(), /plugins/syslog/functions.php[153]:CactiErrorHandler())

- 2022-08-26 11:40:02 - ERROR PHP WARNING in Plugin 'syslog': Undefined variable $retention in file: /var/www/html/cacti/plugins/syslog/functions.php on line: 153

- 2022-08-26 11:40:02 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/syslog/syslog_process.php[143]:syslog_traditional_manage(), /plugins/syslog/functions.php[148]:CactiErrorHandler())

- 2022-08-26 11:40:02 - ERROR PHP WARNING in Plugin 'syslog': Undefined variable $retention in file: /var/www/html/cacti/plugins/syslog/functions.php on line: 148

- 2022-08-26 11:25:03 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/syslog/syslog_process.php[143]:syslog_traditional_manage(), /plugins/syslog/functions.php[144]:CactiErrorHandler())

- 2022-08-26 11:25:03 - ERROR PHP WARNING in Plugin 'syslog': A non-numeric value encountered in file: /var/www/html/cacti/plugins/syslog/functions.php on line: 144

These were the errors in syslog_traditional_manage(). And this is the error of syslog_postprocess_tables().

- 2022-08-26 11:20:02 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/syslog/syslog_process.php[225]:syslog_postprocess_tables(), /plugins/syslog/functions.php[1877]:CactiErrorHandler())

- 2022-08-26 11:20:02 - ERROR PHP WARNING in Plugin 'syslog': A non-numeric value encountered in file: /var/www/html/cacti/plugins/syslog/functions.php on line: 1877
sosrobert commented 2 years ago

Currently the above problems are gone, only this remains:

2022-08-26 14:45:03 - CMDPHP PHP ERROR NOTICE Backtrace: (/script_server.php[189]:fputs(), CactiErrorHandler())
2022-08-26 14:45:03 - ERROR PHP NOTICE: fputs(): Write of 53 bytes failed with errno=32 Broken pipe in file: /var/www/html/cacti/script_server.php on line: 189
TheWitness commented 2 years ago

Use the partitioned table setup. Traditional support should be removed. I'll fix this when I get back to work next week. However, at scale no one should us the traditional setup.

sosrobert commented 2 years ago

Hello! Did you manage to fix the problem, because if so, we want to reinstall syslog? Thanks.

TheWitness commented 2 years ago

Sorry, been distracted on several things, the most recent of which was a trip to the hospital. I'm just getting well enough to start thinking strait ATM.

TheWitness commented 2 years ago

Currently the above problems are gone, only this remains:

2022-08-26 14:45:03 - CMDPHP PHP ERROR NOTICE Backtrace: (/script_server.php[189]:fputs(), CactiErrorHandler())
2022-08-26 14:45:03 - ERROR PHP NOTICE: fputs(): Write of 53 bytes failed with errno=32 Broken pipe in file: /var/www/html/cacti/script_server.php on line: 189

That would appear to be a cacti problem. Can you log it there? This would happen if the script server has crashed for some reason. Likely a bad script.

TheWitness commented 2 years ago

Resolved now.