Increase ping timeout based on ping count and interval
This commit is contained in:
@@ -76,7 +76,8 @@ func (p *Ping) Gather(acc telegraf.Accumulator) error {
|
|||||||
go func(u string) {
|
go func(u string) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
args := p.args(u)
|
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 {
|
if err != nil {
|
||||||
// Combine go err + stderr output
|
// Combine go err + stderr output
|
||||||
errorChannel <- errors.New(
|
errorChannel <- errors.New(
|
||||||
|
|||||||
Reference in New Issue
Block a user