summaryrefslogtreecommitdiff
path: root/internal/check.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/check.go')
-rw-r--r--internal/check.go22
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
+}