Ping telegraf plugin possible issue

I’m using the ping plugin and trying to get minimum_response_ms and maximum_response_ms as shown here: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/ping#measurements--fields

However, all i’m getting is these fields: https://puu.sh/x3kd5/ac2e4736a0.png
With this config:

# # Ping given url(s) and return statistics
[[inputs.ping]]
#   ## NOTE: this plugin forks the ping command. You may need to set capabilities
#   ## via setcap cap_net_raw+p /bin/ping
#   #
#   ## List of urls to ping
   urls = ["97.80.24.132","97.80.24.128","97.80.24.178"] # required
#   ## number of pings to send per collection (ping -c <COUNT>)
 count = 8
#   ## interval, in s, at which to ping. 0 == default (ping -i <PING_INTERVAL>)
#   # ping_interval = 0
#   ## per-ping timeout, in s. 0 == no timeout (ping -W <TIMEOUT>)
#   # timeout = 0
#   ## interface to send ping from (ping -I <INTERFACE>)
#   # interface = ""

Any help would be appreciated!

This can be happen in a number of situations depending on the output of the system ping utility. Can I ask what platform you are running Telegraf on?

I’m running Telegraf v1.3.5 on Ubuntu 14.04.1.

Can you add the output of ping -c 8 -n -s 16 -i 1.0 -W 1.0 97.80.24.132?

PING 8.8.8.8 (8.8.8.8) 16(44) bytes of data.
24 bytes from 8.8.8.8: icmp_seq=1 ttl=61 time=0.990 ms
24 bytes from 8.8.8.8: icmp_seq=2 ttl=61 time=1.06 ms
24 bytes from 8.8.8.8: icmp_seq=3 ttl=61 time=1.09 ms
24 bytes from 8.8.8.8: icmp_seq=4 ttl=61 time=1.04 ms
24 bytes from 8.8.8.8: icmp_seq=5 ttl=61 time=1.09 ms
24 bytes from 8.8.8.8: icmp_seq=6 ttl=61 time=1.06 ms
24 bytes from 8.8.8.8: icmp_seq=7 ttl=61 time=1.11 ms
24 bytes from 8.8.8.8: icmp_seq=8 ttl=61 time=1.03 ms

It doesn’t end with a statistics section? Here is how mine looks with net-misc/iputils-20151218:0 in gentoo:


$ ping -c 8 -n -s 16 -i 1.0 -W 1.0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 16(44) bytes of data.
24 bytes from 8.8.8.8: icmp_seq=1 ttl=60 time=14.6 ms
24 bytes from 8.8.8.8: icmp_seq=2 ttl=60 time=15.0 ms
24 bytes from 8.8.8.8: icmp_seq=3 ttl=60 time=15.2 ms
24 bytes from 8.8.8.8: icmp_seq=4 ttl=60 time=14.6 ms
24 bytes from 8.8.8.8: icmp_seq=5 ttl=60 time=14.3 ms
24 bytes from 8.8.8.8: icmp_seq=6 ttl=60 time=14.4 ms
24 bytes from 8.8.8.8: icmp_seq=7 ttl=60 time=14.4 ms
24 bytes from 8.8.8.8: icmp_seq=8 ttl=60 time=14.6 ms

--- 8.8.8.8 ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7011ms
rtt min/avg/max/mdev = 14.328/14.689/15.261/0.319 ms

Oh geez yes it does so sorry about that. That’s weird because when I run the telegraf command to run the ping input it doesn’t spit out the min and max.

Can you paste the whole output? I’m going to make sure it is parsing correctly, it could be hard to spot any issue.

telegraf --config /etc/telegraf/telegraf.conf --input-filter ping --test
* Plugin: inputs.ping, Collection 1
> ping,url=myhost1,host=web01 packets_transmitted=8i,packets_received=8i,percent_packet_loss=0,average_response_ms=2.119,standard_deviation_ms=0.054 1502333571000000000
> ping,url=myhost2,host=web01 packets_transmitted=8i,packets_received=8i,percent_packet_loss=0,average_response_ms=30.364,standard_deviation_ms=1.398 1502333571000000000
> ping,url=myhost3,host=web01 packets_received=8i,percent_packet_loss=0,average_response_ms=27.303,standard_deviation_ms=0.204,packets_transmitted=8i 1502333571000000000

Can you also paste the full output of $ ping -c 8 -n -s 16 -i 1.0 -W 1.0 8.8.8.8 including the statistics section?

PING 8.8.8.8 (8.8.8.8) 16(44) bytes of data.
24 bytes from 8.8.8.8: icmp_seq=1 ttl=61 time=1.03 ms
24 bytes from 8.8.8.8: icmp_seq=2 ttl=61 time=1.09 ms
24 bytes from 8.8.8.8: icmp_seq=3 ttl=61 time=1.19 ms
24 bytes from 8.8.8.8: icmp_seq=4 ttl=61 time=1.15 ms
24 bytes from 8.8.8.8: icmp_seq=5 ttl=61 time=1.04 ms
24 bytes from 8.8.8.8: icmp_seq=6 ttl=61 time=1.06 ms
24 bytes from 8.8.8.8: icmp_seq=7 ttl=61 time=1.06 ms
24 bytes from 8.8.8.8: icmp_seq=8 ttl=61 time=1.07 ms

— 8.8.8.8 ping statistics —
8 packets transmitted, 8 received, 0% packet loss, time 7008ms
rtt min/avg/max/mdev = 1.035/1.092/1.198/0.060 ms

I can’t find any issue with that output, would it be possible to try running this build of the ping-debug branch with the --test --debug flags and add the output?

Ah! that worked.

root@localhost ~# ./telegraf --config /etc/telegraf/telegraf.conf --input-filter ping --test
* Plugin: inputs.ping, Collection 1
> ping,url=www.google.com,host=localhost packets_received=8i,percent_packet_loss=0,minimum_response_ms=156.757,average_response_ms=157.984,maximum_response_ms=158.541,standard_deviation_ms=0.736,packets_transmitted=8i 1502516199000000000

I don’t think it’s in 1.3.5x. I think it’s only in the unreleased master branch?

Well this is curious, that build only added a logging statement, it shouldn’t have fixed anything. It was based on the unreleased code though, but I can’t recall anything else that would affect this issue.

Can you compare the result if you run as root vs the telegraf user? Just with and without prefixing the command with sudo -u telegraf.

When I run your custom build it says Starting Telegraf v1.4.0~predbcff44

Yes, I expect it would print this. However, I’m not sure why this build would include average_response_ms when the 1.3.5 build does not, nothing that I know of has change with respect to this issue.

This is why I think the output being fixed may be unrelated to the binary. Can you double check that it is fixed with this build and then broken again if you switch back to the 1.3.5 release?

Yes I verified that by swapping out the binary more than once and got the same results.

I guess it will be fixed in 1.4 then. We are planning on doing a release candidate for it this week so it shouldn’t be too long of a wait.