diff --git a/plugins/inputs/ntpq/ntpq.go b/plugins/inputs/ntpq/ntpq.go index 674cd7216..601d5b2df 100644 --- a/plugins/inputs/ntpq/ntpq.go +++ b/plugins/inputs/ntpq/ntpq.go @@ -136,7 +136,7 @@ func (n *NTPQ) Gather(acc telegraf.Accumulator) error { continue } // seconds in an hour - mFields[key] = int64(m) * 360 + mFields[key] = int64(m) * 3600 continue case strings.HasSuffix(when, "d"): m, err := strconv.Atoi(strings.TrimSuffix(fields[index], "d")) diff --git a/plugins/inputs/ntpq/ntpq_test.go b/plugins/inputs/ntpq/ntpq_test.go index 4b6489949..68abab7be 100644 --- a/plugins/inputs/ntpq/ntpq_test.go +++ b/plugins/inputs/ntpq/ntpq_test.go @@ -171,7 +171,7 @@ func TestHoursNTPQ(t *testing.T) { assert.NoError(t, n.Gather(&acc)) fields := map[string]interface{}{ - "when": int64(720), + "when": int64(7200), "poll": int64(256), "reach": int64(37), "delay": float64(51.016),