diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-16 21:34:59 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-16 21:34:59 +0200 |
| commit | e0b58e617a17ec60570d67e11c5ffb6b6173f973 (patch) | |
| tree | f6a4e22af13cc0a03b0af326ffae2cc3341eeede | |
| parent | 81db39feafdc491658f8a10dc604be851a533ffc (diff) | |
fix: show OK checks regardless of stalenessv1.4.1
The staleness filter was incorrectly hiding stale OK checks from the
HTML report and email notifications. OK checks should always be shown
since stale OK alerts are not concerning.
| -rw-r--r-- | internal/html.go | 6 | ||||
| -rw-r--r-- | internal/state.go | 4 | ||||
| -rw-r--r-- | internal/version.go | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/internal/html.go b/internal/html.go index 1a55aa3..7476f4d 100644 --- a/internal/html.go +++ b/internal/html.go @@ -18,7 +18,7 @@ func persistHTMLReport(state state, subject string, conf config) error { log.Println("debug: HTMLStatusFile is empty, skipping HTML report generation") return nil } - + log.Println("debug: HTMLStatusFile set to", htmlFile) htmlDir := filepath.Dir(htmlFile) @@ -241,8 +241,8 @@ func (s state) htmlReportBy(sb *strings.Builder, showStatusChange, isStaleReport if !filter(cs) { continue } - if !isStaleReport && cs.Epoch < s.staleEpoch { - continue // skip stale checks in non-stale report + if !isStaleReport && cs.Epoch < s.staleEpoch && cs.Status != nagiosOk { + continue // skip stale non-OK checks in non-stale report } if cs.Status != nagiosOk && isCheckSuppressed(name, conf) { continue // skip suppressed checks (OK checks are never suppressed) diff --git a/internal/state.go b/internal/state.go index e33d5cb..940cbec 100644 --- a/internal/state.go +++ b/internal/state.go @@ -288,8 +288,8 @@ func (s state) reportBy(sb *strings.Builder, showStatusChange, isStaleReport boo if !filter(cs) { continue } - if !isStaleReport && cs.Epoch < s.staleEpoch { - continue // skip stale checks in non-stale report + if !isStaleReport && cs.Epoch < s.staleEpoch && cs.Status != nagiosOk { + continue // skip stale non-OK checks in non-stale report } if cs.Status != nagiosOk && isCheckSuppressed(name, conf) { continue // skip suppressed checks (OK checks are never suppressed) diff --git a/internal/version.go b/internal/version.go index 9f7a641..4ac76b1 100644 --- a/internal/version.go +++ b/internal/version.go @@ -1,3 +1,3 @@ package internal -const Version = "v1.4.0" +const Version = "v1.4.1" |
