From acf426a3733af96736bcdbf2e614ed08c9f45064 Mon Sep 17 00:00:00 2001 From: Joachim Meyer Date: Wed, 15 Feb 2023 09:09:54 +0100 Subject: [PATCH] Use customcmd commands if they did not error. --- collectors/customCmdMetric.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collectors/customCmdMetric.go b/collectors/customCmdMetric.go index e150014..e89ea54 100644 --- a/collectors/customCmdMetric.go +++ b/collectors/customCmdMetric.go @@ -48,7 +48,7 @@ func (m *CustomCmdCollector) Init(config json.RawMessage) error { command := exec.Command(cmdfields[0], strings.Join(cmdfields[1:], " ")) command.Wait() _, err = command.Output() - if err != nil { + if err == nil { m.commands = append(m.commands, c) } }