2017-07-14 17:43:36 +00:00
|
|
|
# Network Response Input Plugin
|
2016-01-27 00:12:54 +00:00
|
|
|
|
2018-05-08 23:04:28 +00:00
|
|
|
The input plugin test UDP/TCP connections response time and can optional
|
|
|
|
verify text in the response.
|
2016-01-27 00:12:54 +00:00
|
|
|
|
|
|
|
### Configuration:
|
|
|
|
|
2018-05-08 23:04:28 +00:00
|
|
|
```toml
|
|
|
|
# Collect response time of a TCP or UDP connection
|
2016-12-13 16:02:03 +00:00
|
|
|
[[inputs.net_response]]
|
|
|
|
## Protocol, must be "tcp" or "udp"
|
|
|
|
## NOTE: because the "udp" protocol does not respond to requests, it requires
|
|
|
|
## a send/expect string pair (see below).
|
|
|
|
protocol = "tcp"
|
|
|
|
## Server address (default localhost)
|
|
|
|
address = "localhost:80"
|
2018-05-08 23:04:28 +00:00
|
|
|
|
2016-12-13 16:02:03 +00:00
|
|
|
## Set timeout
|
2018-05-08 23:04:28 +00:00
|
|
|
# timeout = "1s"
|
2016-12-13 16:02:03 +00:00
|
|
|
|
|
|
|
## Set read timeout (only used if expecting a response)
|
2018-05-08 23:04:28 +00:00
|
|
|
# read_timeout = "1s"
|
2016-12-13 16:02:03 +00:00
|
|
|
|
|
|
|
## The following options are required for UDP checks. For TCP, they are
|
|
|
|
## optional. The plugin will send the given string to the server and then
|
|
|
|
## expect to receive the given 'expect' string back.
|
|
|
|
## string sent to the server
|
|
|
|
# send = "ssh"
|
|
|
|
## expected string in answer
|
|
|
|
# expect = "ssh"
|
|
|
|
|
2018-05-08 23:04:28 +00:00
|
|
|
## Uncomment to remove deprecated fields; recommended for new deploys
|
2019-03-08 22:10:15 +00:00
|
|
|
# fielddrop = ["result_type", "string_found"]
|
2016-01-27 00:12:54 +00:00
|
|
|
```
|
|
|
|
|
2018-05-08 23:04:28 +00:00
|
|
|
### Metrics:
|
2016-01-27 00:12:54 +00:00
|
|
|
|
|
|
|
- net_response
|
2018-05-08 23:04:28 +00:00
|
|
|
- tags:
|
2016-03-10 19:41:03 +00:00
|
|
|
- server
|
2016-01-27 00:12:54 +00:00
|
|
|
- port
|
|
|
|
- protocol
|
2018-05-08 23:04:28 +00:00
|
|
|
- result
|
|
|
|
- fields:
|
|
|
|
- response_time (float, seconds)
|
|
|
|
- success (int) # success 0, failure 1
|
|
|
|
- result_code (int, success = 0, timeout = 1, connection_failed = 2, read_failed = 3, string_mismatch = 4)
|
|
|
|
- result_type (string) **DEPRECATED in 1.7; use result tag**
|
|
|
|
- string_found (boolean) **DEPRECATED in 1.4; use result tag**
|
2016-01-27 00:12:54 +00:00
|
|
|
|
|
|
|
### Example Output:
|
|
|
|
|
|
|
|
```
|
2018-05-08 23:04:28 +00:00
|
|
|
net_response,port=8086,protocol=tcp,result=success,server=localhost response_time=0.000092948,result_code=0i,result_type="success" 1525820185000000000
|
|
|
|
net_response,port=8080,protocol=tcp,result=connection_failed,server=localhost result_code=2i,result_type="connection_failed" 1525820088000000000
|
|
|
|
net_response,port=8080,protocol=udp,result=read_failed,server=localhost result_code=3i,result_type="read_failed",string_found=false 1525820088000000000
|
2016-01-27 00:12:54 +00:00
|
|
|
```
|