Skip to content

Commit

Permalink
Set reasonable defaults in ping plugin
Browse files Browse the repository at this point in the history
closes #1742
  • Loading branch information
sparrc committed Oct 12, 2016
1 parent a65447d commit 4b5a8a8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions plugins/inputs/ping/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0.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 {
Expand Down Expand Up @@ -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: 0.0,
Count: 1,
Timeout: 1.0,
}
})
}

0 comments on commit 4b5a8a8

Please sign in to comment.