diff options
| author | Paul Buetow <paul@buetow.org> | 2023-04-18 01:04:11 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-04-18 01:04:11 +0300 |
| commit | 7ea496151c0336414c9563613d7c1ce87e28f4ba (patch) | |
| tree | 359bb8f4ef465da31c5cf9aa9bf83fb92f58bcad | |
| parent | 184afd9582636e0beece2195da829ee83cd7007c (diff) | |
remove nagios perf data from output
| -rw-r--r-- | check.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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(), } } |
