fix sysstat timeout error

closes #1134
This commit is contained in:
Rene Zbinden
2016-05-02 15:17:11 -06:00
committed by Cameron Sparr
parent 36d7b5c9ab
commit 4c8449f4bc
+2 -2
View File
@@ -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
}