diff --git a/thold_functions.php b/thold_functions.php index a3bab979..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++; @@ -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),