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 Plugin - FreeBSD - Host is not appended in combination with the arguments option #5437

Closed
h2odriving opened this issue Feb 15, 2019 · 0 comments
Assignees
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@h2odriving
Copy link

Relevant telegraf.conf:

[[inputs.ping]]
   urls = ["9.9.9.9", "8.8.8.8"] # required
   arguments = ["-c", "1", "-n", "-W", "20"]

System info:

  • FreeBSD 12.0-RELEASE-p2 FreeBSD 12.0-RELEASE-p2 GENERIC amd64
  • Telegraf 1.9.0

Steps to reproduce:

In the 1.9.0 version of Telegraf was a bug with the ping plugin in Freebsd (#5112) and I can not upgrade at the moment. So I tried to use the arguments option, since this should ignore all default values. It ignores all default values but also ignore the URL list. The Hosts from the URLs options is not past to the ping command as you can see below.

  • create config file with configuration from above
  • check telegraf:
    telegraf --test --config telegraf.conf --input-filter ping
  • check how the ping command look like:
    ps a |grep "/sbin/ping"

Expected behavior:

$telegraf --test --config /usr/local/etc/telegraf.conf --input-filter ping
2019-02-14T22:38:57Z I! Starting Telegraf 1.9.0
> ping,host=hostname,url=9.9.9.9 average_response_ms=12.199,maximum_response_ms=12.199,minimum_response_ms=12.199,packets_received=1i,packets_transmitted=1i,percent_packet_loss=0,result_code=0i,standard_deviation_ms=0 1550183938000000000
> ping,host=hostname,url=8.8.8.8 average_response_ms=12.199,maximum_response_ms=12.199,minimum_response_ms=12.199,packets_received=1i,packets_transmitted=1i,percent_packet_loss=0,result_code=0i,standard_deviation_ms=0 1550183938000000000
$ps a |grep "/sbin/ping"
 5507  1  R+  0:00.00 /sbin/ping -c 1 -n -W 20 9.9.9.9
10147  1  R+  0:00.00 /sbin/ping -c 1 -n -W 20 8.8.8.8

Actual behavior:

$telegraf --test --config /usr/local/etc/telegraf.conf --input-filter ping
2019-02-14T23:13:40Z I! Starting Telegraf 1.9.0
2019-02-14T23:13:40Z E! [inputs.ping]: Error in plugin: host 8.8.8.8: usage: ping [-AaDdfnoQqRrv] [-c count] [-G sweepmaxsize] [-g sweepminsize]
            [-h sweepincrsize] [-i wait] [-l preload] [-M mask | time] [-m ttl]
            [-P policy] [-p pattern] [-S src_addr] [-s packetsize] [-t timeout]
            [-W waittime] [-z tos] host
       ping [-AaDdfLnoQqRrv] [-c count] [-I iface] [-i wait] [-l preload]
            [-M mask | time] [-m ttl] [-P policy] [-p pattern] [-S src_addr]
            [-s packetsize] [-T ttl] [-t timeout] [-W waittime]
            [-z tos] mcast-group, exit status 64
> ping,host=hostname,url=8.8.8.8 result_code=2i 1550186021000000000
2019-02-14T23:13:40Z E! [inputs.ping]: Error in plugin: host 9.9.9.9: usage: ping [-AaDdfnoQqRrv] [-c count] [-G sweepmaxsize] [-g sweepminsize]
            [-h sweepincrsize] [-i wait] [-l preload] [-M mask | time] [-m ttl]
            [-P policy] [-p pattern] [-S src_addr] [-s packetsize] [-t timeout]
            [-W waittime] [-z tos] host
       ping [-AaDdfLnoQqRrv] [-c count] [-I iface] [-i wait] [-l preload]
            [-M mask | time] [-m ttl] [-P policy] [-p pattern] [-S src_addr]
            [-s packetsize] [-T ttl] [-t timeout] [-W waittime]
            [-z tos] mcast-group, exit status 64
> ping,host=hostname,url=9.9.9.9 result_code=2i 1550186021000000000
$ps aux |grep "/sbin/ping"
20404  1  R+  0:00.00 /sbin/ping -c 1 -n -W 20
27081  1  R+  0:00.00 /sbin/ping -c 1 -n -W 20
@danielnelson danielnelson added this to the 1.10.0 milestone Feb 15, 2019
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Feb 15, 2019
@glinton glinton self-assigned this Feb 19, 2019
@danielnelson danielnelson modified the milestones: 1.10.0, 1.9.5 Feb 19, 2019
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

No branches or pull requests

3 participants