Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions thold_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ?
Expand All @@ -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++;
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand All @@ -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),
Expand Down
Loading