Cacti / plugin_monitor

Monitor Plugin for Cacti
GNU General Public License v2.0
36 stars 39 forks source link

Duplicate SQL errors Monitor 2.3.6 (plugin_monitor_reboot_history' is specified twice) #132

Closed bmfmancini closed 1 year ago

bmfmancini commented 4 years ago

Hey All

I am seeing the following errors in the log from the Monitor

2020/08/18 14:39:10 - CMDPHP ERROR: A DB Exec Failed!, Error: Table 'plugin_monitor_reboot_history' is specified twice, both as a target for 'DELETE' and as a separate source for data
2020/08/18 14:39:10 - CMDPHP ERROR: A DB Exec Failed!, Error: Table 'plugin_monitor_uptime' is specified twice, both as a target for 'DELETE' and as a separate source for data
2020/08/18 14:38:04 - CMDPHP ERROR: A DB Exec Failed!, Error: Table 'plugin_monitor_reboot_history' is specified twice, both as a target for 'DELETE' and as a separate source for data
2020/08/18 14:38:04 - CMDPHP ERROR: A DB Exec Failed!, Error: Table 'plugin_monitor_uptime' is specified twice, both as a target for 'DELETE' and as a separate source for data
2020/08/18 14:37:10 - CMDPHP ERROR: A DB Exec Failed!, Error: Table 'plugin_monitor_reboot_history' is specified twice, both as a target for 'DELETE' and as a separate source for data

SQL backtrace errors

2020/08/18 14:39:10 - CMDPHP SQL Backtrace: (/plugins/monitor/poller_monitor.php[87]:monitor_uptime_checker(), /plugins/monitor/poller_monitor.php[200]:db_execute(), /lib/database.php[213]:db_execute_prepared())
2020/08/18 14:39:10 - CMDPHP SQL Backtrace: (/plugins/monitor/poller_monitor.php[87]:monitor_uptime_checker(), /plugins/monitor/poller_monitor.php[185]:db_execute(), /lib/database.php[213]:db_execute_prepared())
2020/08/18 14:38:04 - CMDPHP SQL Backtrace: (/plugins/monitor/poller_monitor.php[87]:monitor_uptime_checker(), /plugins/monitor/poller_monitor.php[200]:db_execute(), /lib/database.php[213]:db_execute_prepared())
2020/08/18 14:38:04 - CMDPHP SQL Backtrace: (/plugins/monitor/poller_monitor.php[87]:monitor_uptime_checker(), /plugins/monitor/poller_monitor.php[185]:db_execute(), /lib/database.php[213]:db_execute_prepared())
2020/08/18 14:37:10 - CMDPHP SQL Backtrace: (/plugins/monitor/poller_monitor.php[87]:monitor_uptime_checker(), /plugins/monitor/poller_monitor.php[200]:db_execute(), /lib/database.php[213]:db_execute_prepared())

This seems to happen when a device is deleted
if you disable/Uninstall the plugin and install it again the errors go away

netniV commented 4 years ago

Have you updated since yesterday? I fixed something like this then, if not, can you update and check it isn't a duplciate.

bmfmancini commented 4 years ago

Hey

No updates to the plugin for a while on my side

I will pull down the latest code and let you know

Thanks !

On Wed, Aug 19, 2020, 17:25 Mark Brugnoli-Vinten notifications@github.com wrote:

Have you updated since yesterday? I fixed something like this then, if not, can you update and check it isn't a duplciate.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Cacti/plugin_monitor/issues/132#issuecomment-676718518, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGEXTDTYATCNIGSMEWZ6PLSBQ7MXANCNFSM4QD7AWQQ .

bmfmancini commented 4 years ago

Pulled down the new code testing it now

bmfmancini commented 4 years ago

Ouch something is not happy

2020-08-20 12:46:10 - CMDPHP ERROR: A DB Exec Failed!, Error: Out of range value for column 'sysUptime' at row 1 2020-08-20 12:46:10 - CMDPHP SQL Backtrace: (/poller_automation.php[358]:discoverDevices(), /poller_automation.php[750]:db_execute(), /lib/database.php[213]:db_execute_prepared())

New device additions fail as well both Manual and Via Autom8

2020-08-20 12:50:02 - CMDPHP SQL Backtrace: (/host.php[60]:form_save(), /host.php[253]:api_device_save(), /lib/api_device.php[728]:sql_save(), /lib/database.php[1438]:_db_replace(), /lib/database.php[1368]:db_execute(), /lib/database.php[213]:db_execute_prepared()) 2020-08-20 12:50:02 - CMDPHP ERROR: A DB Exec Failed!, Error: Column 'monitor' cannot be null

bmfmancini commented 4 years ago

Monitor plugin disabled to restore ability to add devices

bmfmancini commented 4 years ago

What ever happend here to Monitor also seems to make THOLD not happy ever since the above errors THOLD has been going nutrs with the following alarms

2020-08-20 14:55:14 - CMDPHP SQL Backtrace: (/plugins/thold/thold_daemon.php[288]:db_fetch_cell(), /lib/database.php[386]:db_fetch_cell_prepared(), /lib/database.php[402]:db_execute_prepared())
2020-08-20 14:55:14 - CMDPHP ERROR: A DB Cell Failed!, Error: MySQL server has gone away
2020-08-20 14:55:14 - CMDPHP PHP ERROR WARNING Backtrace: (/plugins/thold/thold_daemon.php[273]:sizeof(), CactiErrorHandler())
2020-08-20 14:55:14 - ERROR PHP WARNING in Plugin 'thold': sizeof(): Parameter must be an array or an object that implements Countable in file: /var/www/html/cacti/plugins/thold/thold_daemon.php on line: 273
2020-08-20 14:55:14 - CMDPHP SQL Backtrace: (/plugins/thold/thold_daemon.php[267]:db_fetch_assoc(), /lib/database.php[476]:db_fetch_assoc_prepared(), /lib/database.php[490]:db_execute_prepared())
2020-08-20 14:55:14 - CMDPHP ERROR: A DB Row Failed!, Error: MySQL server has gone away
2020-08-20 14:55:14 - CMDPHP SQL Backtrace: (/plugins/thold/thold_daemon.php[257]:thold_db_connection(), /plugins/thold/thold_daemon.php[341]:db_fetch_cell(), /lib/database.php[386]:db_fetch_cell_prepared(), /lib/database.php[402]:db_execute_prepared())
2020-08-20 14:55:14 - CMDPHP ERROR: A DB Cell Failed!, Error: MySQL server has gone away
2020-08-20 14:55:14 - CMDPHP SQL Backtrace: (/plugins/thold/thold_daemon.php[288]:db_fetch_cell(), /lib/database.php[386]:db_fetch_cell_prepared(), /lib/database.php[402]:db_execute_prepared())
2020-08-20 14:55:14 - CMDPHP ERROR: A DB Cell Failed!, Error: MySQL server has gone away

Even though the message says mysql has gone away mysql is up and cacti is graphing

netniV commented 4 years ago

thold shouldn't have any direct references to sizeof(), but should be using cacti_sizeof. The real question is what value was being placed into sysUptime from your device, as that seemed to be breaking things.

Did you definitely visit the plugins page to perform the monitor upgrade process?

bmfmancini commented 4 years ago

yes I did a git clone right from the repo those errors were occurring with multiple devices, multiple vendors as well I even tried adding a non-device entry like a ping to google and go the same result all until I removed the monitor plugin

netniV commented 4 years ago

Just updating the plugin folder doesn't do a plugin upgrade though, if there are dB changes, those require visiting the plugins list to update them currently. That is what I'm checking.

bmfmancini commented 4 years ago

Oh and yes forgot to say I disabled the plugin and re-enabled after copying the files

On Sat, Aug 22, 2020, 04:44 Mark Brugnoli-Vinten notifications@github.com wrote:

Just updating the plugin folder doesn't do a plugin upgrade though, if there are dB changes, those require visiting the plugins list to update them currently. That is what I'm checking.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Cacti/plugin_monitor/issues/132#issuecomment-678614698, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGEXTEVDUHF5PEZKI27EPTSB6APZANCNFSM4QD7AWQQ .

TheWitness commented 3 years ago

Update to 2.5.