From 959e620712cb06c23604ba5b8f65eb67897e9a40 Mon Sep 17 00:00:00 2001 From: Rene Zbinden Date: Sun, 1 May 2016 14:05:03 +0200 Subject: [PATCH] fix sysstat timeout error --- plugins/inputs/sysstat/sysstat.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/inputs/sysstat/sysstat.go b/plugins/inputs/sysstat/sysstat.go index c55516716..fe15670ff 100644 --- a/plugins/inputs/sysstat/sysstat.go +++ b/plugins/inputs/sysstat/sysstat.go @@ -199,9 +199,9 @@ func (s *Sysstat) collect() error { options = append(options, strconv.Itoa(collectInterval), "2", s.tmpFile) cmd := execCommand(s.Sadc, options...) - out, err := internal.CombinedOutputTimeout(cmd, time.Second*5) + out, err := internal.CombinedOutputTimeout(cmd, time.Second*time.Duration(collectInterval+parseInterval)) if err != nil { - return fmt.Errorf("failed to run command %s: %s", strings.Join(cmd.Args, " "), string(out)) + return fmt.Errorf("failed to run command %s: %s - %s", strings.Join(cmd.Args, " "), err, string(out)) } return nil }