summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-01-10 00:40:42 +0200
committerPaul Buetow <paul@buetow.org>2026-01-10 00:40:42 +0200
commit64b5c53384cad9b4709fba41b4c2a988bdaf294e (patch)
tree902dda731a282059f7618c567f2321c1156affa4
parente57e76027c20734523cccad0a6e909f3915ecc4c (diff)
only as a warning
-rw-r--r--internal/prometheus.go11
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