summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2023-04-18 01:04:11 +0300
committerPaul Buetow <paul@buetow.org>2023-04-18 01:04:11 +0300
commit7ea496151c0336414c9563613d7c1ce87e28f4ba (patch)
tree359bb8f4ef465da31c5cf9aa9bf83fb92f58bcad
parent184afd9582636e0beece2195da829ee83cd7007c (diff)
remove nagios perf data from output
-rw-r--r--check.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/check.go b/check.go
index 77cdd2e..b0db691 100644
--- a/check.go
+++ b/check.go
@@ -35,9 +35,13 @@ func (c check) execute(ctx context.Context, name string) checkResult {
}
}
+ // Remove Nagios perf data from output and trim whitespaces
+ parts := strings.Split(bytes.String(), "|")
+ output := strings.TrimSpace(parts[0])
+
return checkResult{
name: name,
- output: strings.TrimSuffix(bytes.String(), "\n"),
+ output: output,
status: cmd.ProcessState.ExitCode(),
}
}