Fix documentation for net_response plugin

closes #2103
This commit is contained in:
Cameron Sparr 2016-12-13 16:02:03 +00:00
parent e2f9617228
commit 8a4ab3654d
No known key found for this signature in database
GPG Key ID: 19E67263DCB25D0F
2 changed files with 34 additions and 5 deletions

View File

@ -6,6 +6,27 @@ It can also check response text.
### Configuration: ### Configuration:
``` ```
[[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"
[[inputs.net_response]] [[inputs.net_response]]
protocol = "tcp" protocol = "tcp"
address = ":80" address = ":80"
@ -30,6 +51,8 @@ It can also check response text.
protocol = "udp" protocol = "udp"
address = "localhost:161" address = "localhost:161"
timeout = "2s" timeout = "2s"
send = "hello server"
expect = "hello client"
``` ```
### Measurements & Fields: ### Measurements & Fields:

View File

@ -29,18 +29,24 @@ func (_ *NetResponse) Description() string {
var sampleConfig = ` var sampleConfig = `
## Protocol, must be "tcp" or "udp" ## 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" protocol = "tcp"
## Server address (default localhost) ## Server address (default localhost)
address = "github.com:80" address = "localhost:80"
## Set timeout ## Set timeout
timeout = "1s" timeout = "1s"
## Optional string sent to the server
# send = "ssh"
## Optional expected string in answer
# expect = "ssh"
## Set read timeout (only used if expecting a response) ## Set read timeout (only used if expecting a response)
read_timeout = "1s" 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"
` `
func (_ *NetResponse) SampleConfig() string { func (_ *NetResponse) SampleConfig() string {