From e0b58e617a17ec60570d67e11c5ffb6b6173f973 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 16 Feb 2026 21:34:59 +0200 Subject: fix: show OK checks regardless of staleness 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. --- internal/html.go | 6 +++--- internal/state.go | 4 ++-- 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" -- cgit v1.2.3