Closed
Description
Bug report
When setting the agent.interval to "0s", telegraf panics.
Relevant telegraf.conf:
[agent]
interval = "0s"
System info:
Telegraf vdev-87-g8514acdc (git: master 8514acd)
Steps to reproduce:
- Set agent.interval to "0s"
- Start telegraf
Expected behavior:
Telegraf should report an error and exit.
Actual behavior:
2017/03/20 16:26:27 I! Using config file: /home/dbn/.telegraf/telegraf.conf
2017-03-20T23:26:27Z I! Starting Telegraf (version dev-88-ga962e958)
2017-03-20T23:26:27Z I! Loaded outputs: file
2017-03-20T23:26:27Z I! Loaded inputs: inputs.logparser
2017-03-20T23:26:27Z I! Tags enabled: host=loaner
2017-03-20T23:26:27Z I! Agent Config: Interval:0s, Quiet:false, Hostname:"loaner", Flush Interval:5s
2017/03/20 16:26:27 Seeked 2484.log - &{Offset:0 Whence:0}
panic: runtime error: integer divide by zero
goroutine 1 [running]:
github.com/influxdata/telegraf/agent.(*Agent).Run(0xc42000e038, 0xc420430180, 0x0, 0x0)
/home/dbn/src/influx/src/github.com/influxdata/telegraf/agent/agent.go:364 +0x569
main.reloadLoop(0xc420286060, 0x19d47f8, 0x0, 0x0, 0x19d47f8, 0x0, 0x0, 0x19d47f8, 0x0, 0x0, ...)
/home/dbn/src/influx/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:214 +0xa01
main.main()
/home/dbn/src/influx/src/github.com/influxdata/telegraf/cmd/telegraf/telegraf.go:367 +0x647