Telegraf: [Windows] [[inputs.ping]] `ping_interval` is not defined in `*ping.Ping' if `ping_interval' is enabled

Created on 16 Jun 2017  路  7Comments  路  Source: influxdata/telegraf

Enabling the ping_interval line generates error and fails.

Relevant telegraf.conf:

Default configuration file
+

# +++
  [[inputs.ping]]
    ## List of urls to ping
    urls = ["www.google.com"] # required
    ## number of pings to send per collection (ping -c <COUNT>)
    count = 1
    ## interval, in s, at which to ping. 0 == default (ping -i <PING_INTERVAL>)
    ping_interval = 1.0
    ## per-ping timeout, in s. 0 == no timeout (ping -W <TIMEOUT>)
    # timeout = 1.0
    ## interface to send ping from (ping -I <INTERFACE>)
    # interface = ""

System info:

Telegraf version: 1.3.2,
OS: Windows 8 - 64-bit

Steps to reproduce:

  1. Download telegraf 1.3.2, and extract
  2. Only add ping plugin specific lines in the inputs section
  3. Un-comment the lines with count and ping_interval

Expected behavior:

Khaled@VM81-64 C:\Users\Khaled\Downloads\telegraf-1.3.2_windows_amd64\telegraf
$ telegraf.exe --config telegraf.conf --test --input-filter ping
* Plugin: inputs.ping, Collection 1
> ping,url=www.google.com,host=VM81-64 packets_transmitted=1i,reply_received=1i,packets_received=1i,percent_packet_loss=0,percent_reply_loss=0,average_response_ms=59,minimum_response_ms=59,maximum_response_ms=59 1497629721000000000

Actual behavior:

Khaled@VM81-64 C:\Users\Khaled\Downloads\telegraf-1.3.2_windows_amd64\telegraf
$ telegraf.exe --config telegraf.conf --input-filter ping --test
2017/06/16 22:00:22 E! Error parsing telegraf.conf, line 224: field corresponding to `ping_interval' is not defined in `*ping.Ping'
platforwindows

Most helpful comment

As a quick improvement I added a comment that ping_interval does not work in Windows. https://github.com/influxdata/telegraf/commit/ba364988dec019cce1df16d0a90e75722e766215

I think this is probably all we should do for this option. For the count option, I set the value to 1.

All 7 comments

Turns out ping plugin on Windows don't have the option to mention the interval.

Also, FYI, it also fails with the count line commented. There should be a default count value.

$ telegraf.exe --usage ping
# Ping given url(s) and return statistics
[[inputs.ping]]
        ## urls to ping
        urls = ["www.google.com"] # required

        ## number of pings to send per collection (ping -n <COUNT>)
        count = 4 # required

        ## Ping timeout, in seconds. 0 means default timeout (ping -w <TIMEOUT>)
        Timeout = 0

In that case, this should be marked as a missing feature.

As a quick improvement I added a comment that ping_interval does not work in Windows. https://github.com/influxdata/telegraf/commit/ba364988dec019cce1df16d0a90e75722e766215

I think this is probably all we should do for this option. For the count option, I set the value to 1.

awesome @danielnelson; that was quick !

I haven't actually tested it, since I don't have a Windows machine. Maybe you could give it a spin sometime after tonight (only builds once each night).

https://dl.influxdata.com/telegraf/nightlies/telegraf-nightly_windows_amd64.zip

@danielnelson it works perfectly with the nightly (version 1.3.0~n201705270831), thanks.
Just a nit-pick, can't we just "default" the count to 1 for Windows, to skip mentioning it in config in that case?

I did this as part of the patch so you should be fine to remove the count option.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bregor picture Bregor  路  3Comments

mabushey picture mabushey  路  3Comments

efficks picture efficks  路  3Comments

corentingi picture corentingi  路  3Comments

yn1v picture yn1v  路  3Comments