2017-04-13 00:46:48 +00:00
# Ping Input plugin
2016-08-09 07:27:30 +00:00
This input plugin will measures the round-trip
2016-12-14 19:47:48 +00:00
### Configuration:
2017-04-13 00:46:48 +00:00
2016-08-09 07:27:30 +00:00
```
2017-04-13 00:46:48 +00:00
# NOTE: this plugin forks the ping command. You may need to set capabilities
# via setcap cap_net_raw+p /bin/ping
[[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>)
2017-06-16 20:32:04 +00:00
## Not available in Windows.
2017-04-13 00:46:48 +00:00
# ping_interval = 1.0
## per-ping timeout, in s. 0 == no timeout (ping -W <TIMEOUT>)
# timeout = 1.0
2018-02-16 04:11:07 +00:00
## total-ping deadline, in s. 0 == no deadline (ping -w <DEADLINE>)
# deadline = 10
2018-01-29 22:01:00 +00:00
## interface or source address to send ping from (ping -I <INTERFACE/SRC_ADDR>)
## on Darwin and Freebsd only source address possible: (ping -S <SRC_ADDR>)
2017-04-13 00:46:48 +00:00
# interface = ""
2016-08-09 07:27:30 +00:00
```
2017-04-13 00:46:48 +00:00
2016-08-09 07:27:30 +00:00
### Measurements & Fields:
2017-04-13 00:46:48 +00:00
2016-08-09 07:27:30 +00:00
- packets_transmitted ( from ping output )
- reply_received ( increasing only on valid metric from echo replay, eg. 'Destination net unreachable' reply will increment packets_received but not reply_received )
- packets_received ( from ping output )
- percent_reply_loss ( compute from packets_transmitted and reply_received )
- percent_packets_loss ( compute from packets_transmitted and packets_received )
2017-10-26 20:35:37 +00:00
- errors ( when host can not be found or wrong parameters is passed to application )
2016-08-09 07:27:30 +00:00
- response time
- average_response_ms ( compute from minimum_response_ms and maximum_response_ms )
- minimum_response_ms ( from ping output )
- maximum_response_ms ( from ping output )
2017-10-26 20:35:37 +00:00
- result_code
- 0: success
- 1: no such host
2018-08-23 20:50:19 +00:00
- 2: ping error
2017-04-13 00:46:48 +00:00
2016-08-09 07:27:30 +00:00
### Tags:
2017-04-13 00:46:48 +00:00
- host
- url
2016-08-09 07:27:30 +00:00
### Example Output:
2017-04-13 00:46:48 +00:00
2016-08-09 07:27:30 +00:00
```
2017-05-12 22:22:29 +00:00
$ ./telegraf --config telegraf.conf --input-filter ping --test
2016-08-09 07:27:30 +00:00
* Plugin: ping, Collection 1
2017-10-26 20:35:37 +00:00
ping,host=WIN-PBAPLP511R7,url=www.google.com result_code=0i,average_response_ms=7i,maximum_response_ms=9i,minimum_response_ms=7i,packets_received=4i,packets_transmitted=4i,percent_packet_loss=0,percent_reply_loss=0,reply_received=4i 1469879119000000000
2016-12-14 19:47:48 +00:00
```