From 43daa9b0c3e18042be76ac46ecd9e3e076dcb068 Mon Sep 17 00:00:00 2001 From: Sean Mancini Date: Sun, 16 Aug 2026 22:41:58 -0400 Subject: [PATCH 1/2] for for 750 --- thold_functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/thold_functions.php b/thold_functions.php index a3bab979..9b2e90e6 100644 --- a/thold_functions.php +++ b/thold_functions.php @@ -3390,7 +3390,7 @@ function thold_check_threshold(&$thold_data) { 'host_id' => $thold_data['host_id'], 'local_graph_id' => $thold_data['local_graph_id'], 'threshold_id' => $thold_data['id'], - 'threshold_value' => ($breach_up ? $thold_data['time_hi'] : $thold_data['time_low']), + 'threshold_value' => ($warning_breach_up ? $thold_data['time_warning_hi'] : $thold_data['time_warning_low']), 'current' => $thold_data['lastread'], 'status' => ($ra ? ST_NOTIFYRAW : ST_NOTIFYWA), 'description' => ($maint_dev ? $subject . '. ' . __('Only logging, maint device', 'thold') : $subject), @@ -3406,7 +3406,7 @@ function thold_check_threshold(&$thold_data) { 'host_id' => $thold_data['host_id'], 'local_graph_id' => $thold_data['local_graph_id'], 'threshold_id' => $thold_data['id'], - 'threshold_value' => ($warning_breach_up ? $thold_data['time_hi'] : $thold_data['time_low']), + 'threshold_value' => ($warning_breach_up ? $thold_data['time_warning_hi'] : $thold_data['time_warning_low']), 'current' => $thold_data['lastread'], 'status' => ST_NOTIFYRAW, 'description' => ($maint_dev ? $subject . '. ' . __('Only logging, maint device', 'thold') : $subject), @@ -3420,7 +3420,7 @@ function thold_check_threshold(&$thold_data) { 'host_id' => $thold_data['host_id'], 'local_graph_id' => $thold_data['local_graph_id'], 'threshold_id' => $thold_data['id'], - 'threshold_value' => ($warning_breach_up ? $thold_data['time_hi'] : $thold_data['time_low']), + 'threshold_value' => ($warning_breach_up ? $thold_data['time_warning_hi'] : $thold_data['time_warning_low']), 'current' => $thold_data['lastread'], 'status' => ST_TRIGGERW, 'description' => ($maint_dev ? $subject . '. ' . __('Only logging, maint device', 'thold') : $subject), From 92f461b2f0c8b933c6d011508828f7fe6d9d85fd Mon Sep 17 00:00:00 2001 From: Sean Mancini Date: Mon, 17 Aug 2026 11:23:43 -0400 Subject: [PATCH 2/2] Fix #745: warning realert window uses repeat_alert, not time_warning_fail_length The type 2 warning re-alert window was computed from time_warning_fail_length (the warning time-window length) instead of repeat_alert (the configured re-alert interval). The $ra guard's truthy test used the same wrong field. This caused warning re-alerts to fire at a cadence controlled by the wrong setting. The alert path (thold_functions.php:3136) already uses repeat_alert correctly; this aligns the warning path to match. --- thold_functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thold_functions.php b/thold_functions.php index 9b2e90e6..59a42e95 100644 --- a/thold_functions.php +++ b/thold_functions.php @@ -3286,7 +3286,7 @@ function thold_check_threshold(&$thold_data) { * we should only re-alert X minutes after last email, not every 5 pollings, etc... * re-alert? */ - $realerttime = ($thold_data['time_warning_fail_length'] - 1) * $step; + $realerttime = ($thold_data['repeat_alert'] - 1) * $step; $lastemailtime = db_fetch_cell_prepared('SELECT time FROM plugin_thold_log WHERE threshold_id = ? @@ -3295,7 +3295,7 @@ function thold_check_threshold(&$thold_data) { LIMIT 1', [$thold_data['id'], ST_NOTIFYRAW, ST_NOTIFYWA]); - $ra = ($warning_failures > $warning_trigger && $thold_data['time_warning_fail_length'] && !empty($lastemailtime) && ($lastemailtime + $realerttime <= time())); + $ra = ($warning_failures > $warning_trigger && $thold_data['repeat_alert'] && !empty($lastemailtime) && ($lastemailtime + $realerttime <= time())); if (!$maint_dev) { $warning_failures++;