Closed sgvfr closed 6 months ago
Please show result of sql query:
describe host;
Column snmp_sysUpTimeInstance
must be bigint(20) unsigned NOT NULL DEFAULT 0
Have you here different definition?
You can try change one line 240 in setup.php from: array($host['id'], date('Y-m-d H:i:s', (time()-$host['snmp_sysUpTimeInstance']))); to array($host['id'], date('Y-m-d H:i:s', (time()-intval($host['snmp_sysUpTimeInstance']))));
hi,
+------------------------+-----------------------+------+-----+---------------------+-------------------------------+ | Field | Type | Null | Key | Default | Extra | +------------------------+-----------------------+------+-----+---------------------+-------------------------------+ | snmp_sysUpTimeInstance | bigint(20) unsigned | NO | | 0 | |
it's not exactly how you say it should be. Would that be the cause of the problem for me?
Error is "($timestamp) must be of type int, float given" It is here: (time()-$host['snmp_sysUpTimeInstance']) - error says that this isn't integer but float. Time always returns int. $host... is bigint. So no float.
Sorry - I made mistake in workaround: You can try change one line 240 in poller_monitor.php from: array($host['id'], date('Y-m-d H:i:s', (time()-$host['snmp_sysUpTimeInstance']))); to array($host['id'], date('Y-m-d H:i:s', (time()-intval($host['snmp_sysUpTimeInstance']))));
that seems to have fixed it, the error is gone, and the plugin remained enabled.
Ok, wait few hours and let me know
2 hours. still no errors, and plugin has not disabled.
Great!
@xmacan,
It's not float, but bigint.
| snmp_community | varchar(100) | YES | | NULL | |
| snmp_version | tinyint(3) unsigned | NO | | 1 | |
| snmp_username | varchar(50) | YES | | NULL | |
| snmp_password | varchar(50) | YES | | NULL | |
| snmp_auth_protocol | char(6) | YES | | | |
| snmp_priv_passphrase | varchar(200) | YES | | | |
| snmp_priv_protocol | char(6) | YES | | | |
| snmp_context | varchar(64) | YES | | | |
| snmp_engine_id | varchar(64) | YES | | | |
| snmp_port | mediumint(8) unsigned | NO | | 161 | |
| snmp_timeout | mediumint(8) unsigned | NO | | 500 | |
| snmp_sysDescr | varchar(300) | NO | | | |
| snmp_sysObjectID | varchar(128) | NO | | | |
| snmp_sysUpTimeInstance | bigint(20) unsigned | NO | | 0 | |
| snmp_sysContact | varchar(300) | NO | | | |
| snmp_sysName | varchar(300) | NO | | | |
| snmp_sysLocation | varchar(300) | NO | | | |
Describe the bug in the last week of commits and changes, my monitor plugin crashed, and continues to crash when re-enabled in plugin management. I did try hard resets to the newest code but the problem remains. I'm staying on cacti 4563aaa1d for now because of a separate issue (pinging/advanced ping template seems to stop after 011ae4c but I need to find some more time to test further with pulling in steps to verify)
PHP 8.1.27 (cli) (built: Dec 21 2023 20:19:54) (NTS) SPINE 1.2.25 Copyright 2004-2023 by The Cacti Group
Cacti: 4563aaa1d (HEAD -> develop) Deleted translation using Weblate (English (Old)) plugin_monitor: 396fa1d (HEAD -> develop) Update translation files