diff options
| author | Paul Buetow <paul@buetow.org> | 2026-01-10 00:40:42 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-01-10 00:40:42 +0200 |
| commit | 64b5c53384cad9b4709fba41b4c2a988bdaf294e (patch) | |
| tree | 902dda731a282059f7618c567f2321c1156affa4 | |
| parent | e57e76027c20734523cccad0a6e909f3915ecc4c (diff) | |
only as a warning
| -rw-r--r-- | internal/prometheus.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/internal/prometheus.go b/internal/prometheus.go index c73f1cf..ab92e1a 100644 --- a/internal/prometheus.go +++ b/internal/prometheus.go @@ -32,11 +32,16 @@ func mergePrometheusAlerts(ctx context.Context, state state, conf config) state alerts, host, err := fetchPrometheusAlerts(ctx, conf.PrometheusHosts, timeout) if err != nil { log.Printf("Failed to fetch Prometheus alerts from any host: %v", err) + checkName := "Prometheus alerts" + newStatus := nagiosWarning + if prevState, ok := state.checks[checkName]; ok && prevState.Status == newStatus { + return state + } cs := checkResult{ - name: "Prometheus alerts", - output: fmt.Sprintf("CRITICAL: %v", err), + name: checkName, + output: fmt.Sprintf("WARNING: %v", err), epoch: time.Now().Unix(), - status: nagiosCritical, + status: newStatus, } state.update(cs) return state |
