Increase ping timeout based on ping count and interval
This commit is contained in:
parent
137843b2f6
commit
4cd1f7a104
|
@ -76,7 +76,8 @@ func (p *Ping) Gather(acc telegraf.Accumulator) error {
|
|||
go func(u string) {
|
||||
defer wg.Done()
|
||||
args := p.args(u)
|
||||
out, err := p.pingHost(p.Timeout, args...)
|
||||
totalTimeout := float64(p.Count)*p.Timeout + float64(p.Count-1)*p.PingInterval
|
||||
out, err := p.pingHost(totalTimeout, args...)
|
||||
if err != nil {
|
||||
// Combine go err + stderr output
|
||||
errorChannel <- errors.New(
|
||||
|
|
Loading…
Reference in New Issue