diff options
| author | Paul Buetow <paul@buetow.org> | 2026-01-10 09:57:37 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-01-10 09:57:37 +0200 |
| commit | 005b9645a7c58e9b2486fb35d6038bbe607a3ce7 (patch) | |
| tree | b9bb59bc04f84a66dbd4a4d2883e635ed06b0d38 /internal/state.go | |
| parent | 64b5c53384cad9b4709fba41b4c2a988bdaf294e (diff) | |
fix prometheus handling
Diffstat (limited to 'internal/state.go')
| -rw-r--r-- | internal/state.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/state.go b/internal/state.go index d1225f0..d71c71c 100644 --- a/internal/state.go +++ b/internal/state.go @@ -14,13 +14,13 @@ import ( type checkState struct { Status nagiosCode PrevStatus nagiosCode - Epoch int64 `json:"Epoch,omitempty"` - output string - federatedFrom string + Epoch int64 `json:"Epoch,omitempty"` + Output string `json:"Output,omitempty"` + FederatedFrom string `json:"FederatedFrom,omitempty"` } func (cs checkState) federated() bool { - return cs.federatedFrom != "" + return cs.FederatedFrom != "" } func (cs checkState) changed() bool { @@ -62,7 +62,7 @@ func newState(conf config) (state, error) { var obsolete []string for name := range s.checks { - if _, ok := conf.Checks[name]; !ok { + if _, ok := conf.Checks[name]; !ok && !strings.HasPrefix(name, "Prometheus") { obsolete = append(obsolete, name) } } @@ -240,10 +240,10 @@ func (s state) reportBy(sb *strings.Builder, showStatusChange, isStaleReport boo sb.WriteString(": ") sb.WriteString(name) sb.WriteString(": ") - sb.WriteString(cs.output) + sb.WriteString(cs.Output) if cs.federated() { sb.WriteString(" [federated from ") - sb.WriteString(cs.federatedFrom) + sb.WriteString(cs.FederatedFrom) sb.WriteString("]") } |
