-
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 adds a success entry to Influxdb even during failure #4549
Comments
This issue is addressed in PR #4550 |
Can you paste your full |
Here's the entire telegraf.conf file that I'm using
The error thrown is :
Usage: ping [OPTIONS] HOST Send ICMP ECHO_REQUEST packets to network hosts
Looking at the code , it is quite evident that pingInterval has a default value
And the -i option gets set when the PingInterval is > 0
I tried changing the default PingInterval value to 0.0 and it worked , although I'm not sure if there would be any collateral by doing so. |
You are correct, I only read the Readme which says it defaults to 0. Setting it to 0 will be fine for your case. |
So just to make it clear , I just need to set "ping_interval" to 0.0 explicity in telegraf.conf file and it would work for busybox and other such ping applications which don't have too many ping options(like -i for interval). |
correct, but there is still the issue as you originally described it, where a valid ping metric gets recorded by telegraf rather than it failing on error. |
Yes that's correct ! The PR mentioned earlier addresses that! Once that goes in , it should be resolved! |
Closed in #4550 |
Relevant telegraf.conf:
[[inputs.ping]]
urls = ["8.8.8.8"] # required
System info:
prash@prash-laptop:
/Downloads/telegraf/usr/bin$ ./telegraf -version5f8c983 (git: master 5f8c983)Telegraf v1.8.0
Description:
Telegraf Ping Plugin does not support certain versions of ping . For example , the busybox version of ping is unsupported since it does not support the interval option (-i) which is needed by the ping plugin.In such cases , it is seen that an entry is made into influx as shown below :
`2018-08-13T11:34:10Z E! Error in plugin [inputs.ping]: Fatal error processing ping output: 192.168.1.1
ping,host=3ebf7bd6fcd0,url=192.168.1.1 result_code=0i 1534160050000000000
2018-08-13T11:34:20Z E! Error in plugin [inputs.ping]: Fatal error processing ping output: 192.168.1.1
ping,host=3ebf7bd6fcd0,url=192.168.1.1 result_code=0i 1534160060000000000
2018-08-13T11:34:30Z E! Error in plugin [inputs.ping]: Fatal error processing ping output: 192.168.1.1
`
As seen above , result_code = 0 meaning success(according to the documentation). This can be misleading since it could imply a successful ping even though ping didn't run at all.
Steps to reproduce:
Expected behavior:
result_code should indicate an error instead of success.
Example:
ping,host=e3e8019bc54b,url=192.168.1.1 result_code=2i 1534160890000000000
where result_code=2 can indicate ping error
Actual behavior:
result_code output is "0" indicating successful ping.
Additional info:
The text was updated successfully, but these errors were encountered: