2017-07-14 17:43:36 +00:00
|
|
|
# Network Response Input Plugin
|
2016-01-27 00:12:54 +00:00
|
|
|
|
|
|
|
The input plugin test UDP/TCP connections response time.
|
|
|
|
It can also check response text.
|
|
|
|
|
|
|
|
### Configuration:
|
|
|
|
|
|
|
|
```
|
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"
|
|
|
|
## Set timeout
|
|
|
|
timeout = "1s"
|
|
|
|
|
|
|
|
## Set read timeout (only used if expecting a response)
|
|
|
|
read_timeout = "1s"
|
|
|
|
|
|
|
|
## 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"
|
|
|
|
|
2016-01-27 00:12:54 +00:00
|
|
|
[[inputs.net_response]]
|
|
|
|
protocol = "tcp"
|
|
|
|
address = ":80"
|
|
|
|
|
2016-05-23 12:33:43 +00:00
|
|
|
# TCP or UDP 'ping' given url and collect response time in seconds
|
2016-01-27 00:12:54 +00:00
|
|
|
[[inputs.net_response]]
|
2016-05-23 12:33:43 +00:00
|
|
|
## Protocol, must be "tcp" or "udp"
|
|
|
|
protocol = "tcp"
|
|
|
|
## Server address (default localhost)
|
2016-01-27 00:12:54 +00:00
|
|
|
address = "github.com:80"
|
2016-05-23 12:33:43 +00:00
|
|
|
## Set timeout
|
|
|
|
timeout = "1s"
|
|
|
|
|
|
|
|
## Optional string sent to the server
|
2016-01-27 00:12:54 +00:00
|
|
|
send = "ssh"
|
2016-05-23 12:33:43 +00:00
|
|
|
## Optional expected string in answer
|
2016-01-27 00:12:54 +00:00
|
|
|
expect = "ssh"
|
2016-05-23 12:33:43 +00:00
|
|
|
## Set read timeout (only used if expecting a response)
|
|
|
|
read_timeout = "1s"
|
2016-01-27 00:12:54 +00:00
|
|
|
|
|
|
|
[[inputs.net_response]]
|
|
|
|
protocol = "udp"
|
|
|
|
address = "localhost:161"
|
2016-05-23 12:33:43 +00:00
|
|
|
timeout = "2s"
|
2016-12-13 16:02:03 +00:00
|
|
|
send = "hello server"
|
|
|
|
expect = "hello client"
|
2016-01-27 00:12:54 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Measurements & Fields:
|
|
|
|
|
|
|
|
- net_response
|
|
|
|
- response_time (float, seconds)
|
2018-05-08 23:07:15 +00:00
|
|
|
- success (int) # success 0, failure 1
|
|
|
|
- result_code (int) # success = 0, Failure = 1
|
|
|
|
- [**DEPRECATED**] result_type (string) # success, timeout, connection_failed, read_failed, string_mismatch
|
2017-07-14 17:43:36 +00:00
|
|
|
- [**DEPRECATED**] string_found (boolean)
|
2016-01-27 00:12:54 +00:00
|
|
|
|
|
|
|
### Tags:
|
|
|
|
|
|
|
|
- All measurements have the following tags:
|
2016-03-10 19:41:03 +00:00
|
|
|
- server
|
2016-01-27 00:12:54 +00:00
|
|
|
- port
|
|
|
|
- protocol
|
2018-05-08 23:07:15 +00:00
|
|
|
- result_text (string) # This will contain the text from the now deprecated result_type
|
2016-01-27 00:12:54 +00:00
|
|
|
|
|
|
|
### Example Output:
|
|
|
|
|
|
|
|
```
|
2018-05-08 23:07:15 +00:00
|
|
|
net_response,server=influxdata.com,port=8080,protocol=tcp,host=localhost,result_text="timeout" result_code=1i,result_type="timeout" 1499310361000000000
|
|
|
|
net_response,server=influxdata.com,port=443,protocol=tcp,host=localhost,result_text="success" result_code=0i,result_type="success",response_time=0.088703864 1499310361000000000
|
|
|
|
net_response,protocol=tcp,host=localhost,server=this.domain.does.not.exist,port=443,result_text="connection_failed" result_code=1i,result_type="connection_failed" 1499310361000000000
|
|
|
|
net_response,protocol=udp,host=localhost,server=influxdata.com,port=8080,result_text="read_failed" result_code=1i,result_type="read_failed" 1499310362000000000
|
|
|
|
net_response,port=31338,protocol=udp,host=localhost,server=localhost,result_text="string_mismatch" result_code=1i,result_type="string_mismatch",string_found=false,response_time=0.00242682 1499310362000000000
|
|
|
|
net_response,protocol=udp,host=localhost,server=localhost,port=31338,result_text="success" response_time=0.001128598,result_code=0i,result_type="success",string_found=true 1499310362000000000
|
|
|
|
net_response,server=this.domain.does.not.exist,port=443,protocol=udp,host=localhost,result_text="connection_failed" result_code=1i,result_type="connection_failed" 1499310362000000000
|
2016-01-27 00:12:54 +00:00
|
|
|
```
|