From 820b4e6c483734ba1d57ecdd28838657d18b3159 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 22 Jan 2026 09:44:59 +0200 Subject: fix OK checks incorrectly shown in suppressed section OK checks should appear in "OK checks" section, not "Suppressed alerts". Suppression now only applies to non-OK checks (Critical, Warning, Unknown). Co-Authored-By: Claude Opus 4.5 --- internal/html.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'internal/html.go') diff --git a/internal/html.go b/internal/html.go index e2843db..71f17e4 100644 --- a/internal/html.go +++ b/internal/html.go @@ -194,11 +194,12 @@ func (s state) htmlReportStaleAlerts(sb *strings.Builder, conf config) int { } // htmlReportSuppressed generates HTML for suppressed checks. -// Shows which checks are currently muted via OnlyIfNotExists for visibility. +// Shows which non-OK checks are currently muted via OnlyIfNotExists for visibility. +// OK checks are never shown as suppressed since there's nothing to suppress. func (s state) htmlReportSuppressed(sb *strings.Builder, conf config) (count int) { for name, cs := range s.checks { - if !isCheckSuppressed(name, conf) { - continue + if cs.Status == nagiosOk || !isCheckSuppressed(name, conf) { + continue // OK checks are never shown as suppressed } count++ @@ -219,10 +220,11 @@ func (s state) htmlReportSuppressed(sb *strings.Builder, conf config) (count int return } -// countSuppressed counts the number of suppressed checks. +// countSuppressed counts the number of suppressed non-OK checks. +// OK checks are never counted as suppressed since there's nothing to suppress. func (s state) countSuppressed(conf config) (count int) { for name := range s.checks { - if isCheckSuppressed(name, conf) { + if s.checks[name].Status != nagiosOk && isCheckSuppressed(name, conf) { count++ } } @@ -242,8 +244,8 @@ func (s state) htmlReportBy(sb *strings.Builder, showStatusChange, isStaleReport if !isStaleReport && cs.Epoch < s.staleEpoch { continue // skip stale checks in non-stale report } - if isCheckSuppressed(name, conf) { - continue // skip suppressed checks + if cs.Status != nagiosOk && isCheckSuppressed(name, conf) { + continue // skip suppressed checks (OK checks are never suppressed) } count++ -- cgit v1.2.3