diff --git a/plugins/inputs/ntpq/ntpq.go b/plugins/inputs/ntpq/ntpq.go index edcdac3d4..e9dc1cc14 100644 --- a/plugins/inputs/ntpq/ntpq.go +++ b/plugins/inputs/ntpq/ntpq.go @@ -122,6 +122,9 @@ func (n *NTPQ) Gather(acc telegraf.Accumulator) error { if index == -1 { continue } + if fields[index] == "-" { + continue + } if key == "when" { when := fields[index] @@ -169,6 +172,9 @@ func (n *NTPQ) Gather(acc telegraf.Accumulator) error { if index == -1 { continue } + if fields[index] == "-" { + continue + } m, err := strconv.ParseFloat(fields[index], 64) if err != nil {