Set reasonable defaults in ping plugin

closes #1742
This commit is contained in:
Cameron Sparr 2016-10-12 12:12:07 +01:00
parent a65447d22e
commit a4e8f24b16
2 changed files with 11 additions and 5 deletions

View File

@ -68,6 +68,7 @@ continue sending logs to /var/log/telegraf/telegraf.log.
- [#1344](https://github.com/influxdata/telegraf/issues/1344): Fix config file parse error logging.
- [#1771](https://github.com/influxdata/telegraf/issues/1771): Delete nil fields in the metric maker.
- [#870](https://github.com/influxdata/telegraf/issues/870): Fix MySQL special characters in DSN parsing.
- [#1742](https://github.com/influxdata/telegraf/issues/1742): Ping input odd timeout behavior.
## v1.0.1 [2016-09-26]

View File

@ -52,13 +52,13 @@ const sampleConfig = `
## urls to ping
urls = ["www.google.com"] # required
## number of pings to send per collection (ping -c <COUNT>)
count = 1 # required
# count = 1
## interval, in s, at which to ping. 0 == default (ping -i <PING_INTERVAL>)
ping_interval = 0.0
# ping_interval = 1.0
## per-ping timeout, in s. 0 == no timeout (ping -W <TIMEOUT>)
timeout = 1.0
# timeout = 1.0
## interface to send ping from (ping -I <INTERFACE>)
interface = ""
# interface = ""
`
func (_ *Ping) SampleConfig() string {
@ -200,6 +200,11 @@ func processPingOutput(out string) (int, int, float64, error) {
func init() {
inputs.Add("ping", func() telegraf.Input {
return &Ping{pingHost: hostPinger}
return &Ping{
pingHost: hostPinger,
PingInterval: 1.0,
Count: 1,
Timeout: 1.0,
}
})
}