Skip to content
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

Closed
kostasb opened this issue Sep 9, 2016 · 0 comments · Fixed by #1890
Closed

ping input plugin timeout #1742

kostasb opened this issue Sep 9, 2016 · 0 comments · Fixed by #1890
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@kostasb
Copy link

kostasb commented Sep 9, 2016

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.

@sparrc sparrc added the bug unexpected problem or unintended behavior label Sep 9, 2016
@sparrc sparrc added this to the 1.1.0 milestone Sep 9, 2016
sparrc added a commit that referenced this issue Oct 12, 2016
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
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants