Skip to content

Fix #745: warning realert window uses repeat_alert, not time_warning_fail_length - #805

Open
bmfmancini wants to merge 2 commits into
Cacti:developfrom
bmfmancini:fix/745-warning-realert-window-wrong-field
Open

Fix #745: warning realert window uses repeat_alert, not time_warning_fail_length#805
bmfmancini wants to merge 2 commits into
Cacti:developfrom
bmfmancini:fix/745-warning-realert-window-wrong-field

Conversation

@bmfmancini

Copy link
Copy Markdown
Member

Summary

Fixes #745.

The type 2 (time-based) 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.

// Warning path (wrong — before):
$realerttime = ($thold_data['time_warning_fail_length'] - 1) * $step;
$ra = (... && $thold_data['time_warning_fail_length'] && ...);

// Alert path (correct — unchanged):
$realerttime = ($thold_data['repeat_alert'] - 1) * $step;
$ra = (... && $thold_data['repeat_alert'] && ...);

Impact

Warning re-alerts fired at a cadence controlled by the wrong setting (time_warning_fail_length) rather than the configured re-alert interval (repeat_alert).

Fix

Both the $realerttime computation and the $ra guard now use repeat_alert, matching the alert path at thold_functions.php:3136.

Testing

  • php -l thold_functions.php — no syntax errors.
  • Diff is two field-name changes only; indentation preserved.

…ning_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.
Copilot AI lite review requested due to automatic review settings August 17, 2026 15:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@somethingwithproof somethingwithproof left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repeat_alert correction is directionally correct, but this branch also carries three unrelated threshold_value edits from #789. Please remove those hunks so this PR contains only #745, then add Cacti-Composer/Pest coverage for initial warning, no early re-alert, and re-alert at the configured interval. A syntax check cannot validate this state machine, and the current integration matrix is red.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Type 2 warning realert window uses wrong config field (time_warning_fail_length instead of repeat_alert)

3 participants