From c7b3667ac4d0d4786c58e1172de5be7fe72ed379 Mon Sep 17 00:00:00 2001 From: Fred Cox Date: Mon, 23 Apr 2018 23:27:29 +0300 Subject: [PATCH] Add server argument as first argument in unbound input (#4062) --- plugins/inputs/unbound/unbound.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/inputs/unbound/unbound.go b/plugins/inputs/unbound/unbound.go index 6bed9ea75..798879664 100644 --- a/plugins/inputs/unbound/unbound.go +++ b/plugins/inputs/unbound/unbound.go @@ -87,7 +87,7 @@ func unboundRunner(cmdName string, Timeout internal.Duration, UseSudo bool, Serv server = server + "@" + port } - cmdArgs = append(cmdArgs, "-s", server) + cmdArgs = append([]string{"-s", server}, cmdArgs...) } cmd := exec.Command(cmdName, cmdArgs...) @@ -101,7 +101,7 @@ func unboundRunner(cmdName string, Timeout internal.Duration, UseSudo bool, Serv cmd.Stdout = &out err := internal.RunTimeout(cmd, Timeout.Duration) if err != nil { - return &out, fmt.Errorf("error running unbound-control: %s", err) + return &out, fmt.Errorf("error running unbound-control: %s (%s %v)", err, cmdName, cmdArgs) } return &out, nil