Cacti / plugin_npc

Nagios Plugin for Cacti is a complete UI replacement for Nagios fully integrated into Cacti.
GNU General Public License v3.0
4 stars 3 forks source link

CMDPHP PHP ERROR NOTICE Backtrace & ERROR PHP NOTICE in Plugin 'npc' #15

Open sunman2 opened 1 month ago

sunman2 commented 1 month ago

This issue has been asked before, but how it was resolved has not been explained.

Version Info: Linux: Ubuntu 20.04.5 LTS Apache 2.4.41 MySQL 8.0.36-0ubuntu0.20.04.1 PHP 7.4.3-4ubuntu2.19 (cli) cacti-1.2.19. ndoutils 2.1.3 Nagios4.4.5 After clicking NPC tab working ok but showing following errors in logs error :

2024-05-30 22:53:27 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/npc/npc.php[83]:NpcNagiosController->getProgramStatus(), /plugins/npc/controllers/nagios.php[42]:NpcNagiosController->processInfo(), /plugins/npc/controllers/nagios.php[109]:CactiErrorHandler())

2024-05-30 22:53:27 - ERROR PHP NOTICE in Plugin 'npc': Trying to access array offset on value of type null in file: /var/www/html/cacti/plugins/npc/controllers/nagios.php on line: 109 2024-05-30 22:53:27 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/npc/npc.php[83]:NpcNagiosController->getProgramStatus(), /plugins/npc/controllers/nagios.php[42]:NpcNagiosController->processInfo(), /plugins/npc/controllers/nagios.php[109]:CactiErrorHandler()) 2024-05-30 22:53:27 - ERROR PHP NOTICE in Plugin 'npc': Undefined offset: 0 in file: /var/www/html/cacti/plugins/npc/controllers/nagios.php on line: 109

TheWitness commented 1 month ago

I have not forgotten this. It's a simple test. Might be able to get to it tomorrow.

sunman2 commented 1 month ago

Thank you so much for your reply. I built another instance and installed PHP 7.4 and MySQL 5.7, and it worked perfectly. But with MySQL 8.0.36-0ubuntu0.20.04.1 giving me the same error

TheWitness commented 1 month ago

Should be fixed now.

TheWitness commented 1 month ago

Please report back. I'm going to spend some time on this, though the framework is using Doctrine and getting pretty old now.