diff options
| author | Paul Buetow <paul@buetow.org> | 2025-11-22 09:32:52 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-11-22 09:32:52 +0200 |
| commit | 5fa8012c6b085c8d4244d3b4f9c99c1937fb65a2 (patch) | |
| tree | 6d166352229d903aeb52ca06c66cdc26f54147b9 /internal/check.go | |
| parent | 1cde39e35c0329b4783f188b050b78b520e43470 (diff) | |
more on federation
Diffstat (limited to 'internal/check.go')
| -rw-r--r-- | internal/check.go | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/internal/check.go b/internal/check.go index 3f2e4cc..a171c29 100644 --- a/internal/check.go +++ b/internal/check.go @@ -24,13 +24,17 @@ type namedCheck struct { } type checkResult struct { - name string - output string - epoch int64 - status nagiosCode - federated bool + name string + output string + epoch int64 + status nagiosCode + federatedFrom string } +// func (c checkResult) federated() bool { +// return c.federatedFrom != "" +// } + func (c check) run(ctx context.Context, name string) checkResult { cmd := exec.CommandContext(ctx, c.Plugin, c.Args...) @@ -40,7 +44,7 @@ func (c check) run(ctx context.Context, name string) checkResult { if err := cmd.Run(); err != nil { if ctx.Err() == context.DeadlineExceeded { - return checkResult{name, "Check command timed out", time.Now().Unix(), nagiosCritical, false} + return checkResult{name, "Check command timed out", time.Now().Unix(), nagiosCritical, ""} } } @@ -54,11 +58,11 @@ func (c check) run(ctx context.Context, name string) checkResult { ec = int(nagiosUnknown) } - return checkResult{name, output, time.Now().Unix(), nagiosCode(ec), false} + return checkResult{name, output, time.Now().Unix(), nagiosCode(ec), ""} } func (c check) skip(name, output string) checkResult { - return checkResult{name, output, time.Now().Unix(), nagiosUnknown, false} + return checkResult{name, output, time.Now().Unix(), nagiosUnknown, ""} } func (c namedCheck) run(ctx context.Context) checkResult { @@ -67,4 +71,4 @@ func (c namedCheck) run(ctx context.Context) checkResult { func (c namedCheck) skip(output string) checkResult { return c.check.skip(c.name, output) -}
\ No newline at end of file +} |
