# Ping telegraf plugin possible issue

**URL:** <https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905>\
**Category:** Systems\
**Tags:** telegraf\
**Created:** [August 6, 2017, 8:01pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905 "2017-08-06T20:01:41Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmordica](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jmordica/32/1786_2.png) [@jmordica](https://community.influxdata.com/u/jmordica)\
**Post date:** [August 6, 2017, 8:01pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/1 "2017-08-06T20:01:41Z")

</div>

I’m using the ping plugin and trying to get `minimum_response_ms` and `maximum_response_ms` as shown here: [telegraf/plugins/inputs/ping at master · influxdata/telegraf · GitHub](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](https://puu.sh/x3kd5/ac2e4736a0.png)  
With this config:

```auto
# # 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!

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [August 9, 2017, 8:06pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/2 "2017-08-09T20:06:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jmordica](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jmordica/32/1786_2.png) [@jmordica](https://community.influxdata.com/u/jmordica)\
**Post date:** [August 9, 2017, 8:18pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/3 "2017-08-09T20:18:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [August 9, 2017, 9:37pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/4 "2017-08-09T21:37:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmordica](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jmordica/32/1786_2.png) [@jmordica](https://community.influxdata.com/u/jmordica)\
**Post date:** [August 9, 2017, 9:48pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/5 "2017-08-09T21:48:59Z")

</div>

```auto
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

```

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [August 10, 2017, 12:06am UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/6 "2017-08-10T00:06:32Z")

</div>

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

```auto

$ 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

```

---

<div class="post-metadata">

**Author:** ![jmordica](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jmordica/32/1786_2.png) [@jmordica](https://community.influxdata.com/u/jmordica)\
**Post date:** [August 10, 2017, 12:22am UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/7 "2017-08-10T00:22:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [August 10, 2017, 12:57am UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/8 "2017-08-10T00:57:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmordica](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jmordica/32/1786_2.png) [@jmordica](https://community.influxdata.com/u/jmordica)\
**Post date:** [August 10, 2017, 2:54am UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/9 "2017-08-10T02:54:46Z")

</div>

```auto
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

```

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [August 10, 2017, 11:22pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/10 "2017-08-10T23:22:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jmordica](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jmordica/32/1786_2.png) [@jmordica](https://community.influxdata.com/u/jmordica)\
**Post date:** [August 11, 2017, 12:12am UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/11 "2017-08-11T00:12:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [August 11, 2017, 6:46pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/12 "2017-08-11T18:46:18Z")

</div>

I can’t find any issue with that output, would it be possible to try running [this build](https://7876-33258973-gh.circle-artifacts.com/0/tmp/circle-artifacts.VcdRm6z/telegraf.gz) of the [ping-debug](https://github.com/influxdata/telegraf/commits/ping-debug) branch with the `--test --debug` flags and add the output?

---

<div class="post-metadata">

**Author:** ![jmordica](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jmordica/32/1786_2.png) [@jmordica](https://community.influxdata.com/u/jmordica)\
**Post date:** [August 12, 2017, 5:37am UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/13 "2017-08-12T05:37:16Z")

</div>

Ah! that worked.

```auto
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

```

---

<div class="post-metadata">

**Author:** ![jmordica](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jmordica/32/1786_2.png) [@jmordica](https://community.influxdata.com/u/jmordica)\
**Post date:** [August 12, 2017, 6:12am UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/14 "2017-08-12T06:12:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [August 14, 2017, 6:13pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/15 "2017-08-14T18:13:52Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![jmordica](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jmordica/32/1786_2.png) [@jmordica](https://community.influxdata.com/u/jmordica)\
**Post date:** [August 15, 2017, 5:09am UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/16 "2017-08-15T05:09:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [August 15, 2017, 6:55pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/17 "2017-08-15T18:55:59Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jmordica](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jmordica/32/1786_2.png) [@jmordica](https://community.influxdata.com/u/jmordica)\
**Post date:** [August 15, 2017, 8:49pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/18 "2017-08-15T20:49:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [August 15, 2017, 10:17pm UTC](https://community.influxdata.com/t/ping-telegraf-plugin-possible-issue/1905/19 "2017-08-15T22:17:13Z")

</div>

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.
