From 7ea616b73c02acf47475d7618b108b5f3f41b29b Mon Sep 17 00:00:00 2001 From: TheWitness Date: Tue, 7 Sep 2021 10:56:44 -0400 Subject: [PATCH] Fixing issue #4391 - Boost errors When system level polling is disabled Boost shows poller crashed errors and creates many arch tables --- CHANGELOG | 1 + poller.php | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e6ef1e520b..6b2bdbc618 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ Cacti CHANGELOG -issue#4381: Fatal Errors can occur if you are not in a transaction and you attempt to commit one -issue#4382: SNMP Agent may not find a cache item -issue#4383: Fixes error callbacks for php 8.0+ +-issue#4391: When system level polling is disabled Boost shows poller crashed errors and creates many arch tables -feature: Add a normal/wrap class for general use -feature#4344: Add a 15 minute poller interval to global_arrays.php -feature#4385: Add additional admin email notifications diff --git a/poller.php b/poller.php index 502118e01f..49d721d462 100755 --- a/poller.php +++ b/poller.php @@ -890,18 +890,24 @@ function poller_replicate_check() { function poller_enabled_check($poller_id) { global $poller_db_cnn_id; - $disabled = db_fetch_cell_prepared('SELECT disabled + $poller_disabled = db_fetch_cell_prepared('SELECT disabled FROM poller WHERE id = ?', array($poller_id), '', true, $poller_db_cnn_id); - if ($disabled == 'on') { + $system_enabled = read_config_option('poller_enabled'); + + if ($system_enabled == '') { + cacti_log('WARNING: System Polling is Disabled! Therefore, data collection from the poller will be suspended till re-enabled.', true, 'SYSTEM'); + + exit(1); + } elseif ($poller_disabled == 'on') { db_execute_prepared('UPDATE poller SET last_status=NOW() WHERE id = ?', array($poller_id), true, $poller_db_cnn_id); - cacti_log('WARNING: Poller ' . $poller_id . ' is Disabled, graphing or other activities are running', true, 'SYSTEM'); + cacti_log('WARNING: Poller ' . $poller_id . ' is Disabled. Therefore, data collection for this Poller will be suspended till it\'s re-enabled.', true, 'SYSTEM'); exit(1); }