-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ping input plugin timeout #1742
Comments
sparrc
added a commit
that referenced
this issue
Oct 12, 2016
3 tasks
sparrc
added a commit
that referenced
this issue
Oct 12, 2016
sparrc
added a commit
that referenced
this issue
Oct 17, 2016
sparrc
added a commit
that referenced
this issue
Oct 17, 2016
sparrc
added a commit
that referenced
this issue
Oct 17, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue: Telegraf ping input plugin assumes a default ping_interval of 0, which should be 1 instead.
Steps to reproduce:
run the ping input plugin against any URL with a count > 1 , leaving the interval and timeout config parameters default to 0.
Details:
The default Linux ping interval is to wait for one second between each packet, but Telegraf assigns a default value of 0.
This does not affect the actual ping exec command as no argument is passed to it in this case, but it does affect the calculation of totalTimeout as per
totalTimeout := float64(p.Count)*p.Timeout + float64(p.Count-1)*p.PingInterval
, which results to 0.When the CombinedOutputTimeout function is called as
out, err := internal.CombinedOutputTimeout(c,time.Second*time.Duration(timeout+1))
the Duration passed to it as argument is timeout+1=1.If the actual execution time for the execution of "ping" lasts longer than 1 second (which it will , when count is >1 ), a timeout error is thrown by CombinedOutputTimeout.
Setting the timeout config option to a value other than 0 can conceal the issue.
The text was updated successfully, but these errors were encountered: