Skip to content

Commit

Permalink
Fix documentation for net_response plugin
Browse files Browse the repository at this point in the history
closes #2103
  • Loading branch information
sparrc committed Dec 13, 2016
1 parent a5fd775 commit b78859b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
23 changes: 23 additions & 0 deletions plugins/inputs/net_response/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@ It can also check response text.
### 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]]
protocol = "tcp"
address = ":80"
Expand All @@ -30,6 +51,8 @@ It can also check response text.
protocol = "udp"
address = "localhost:161"
timeout = "2s"
send = "hello server"
expect = "hello client"
```

### Measurements & Fields:
Expand Down
16 changes: 11 additions & 5 deletions plugins/inputs/net_response/net_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,24 @@ func (_ *NetResponse) Description() string {

var sampleConfig = `
## 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 = "github.com:80"
address = "localhost:80"
## Set timeout
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)
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 {
Expand Down

0 comments on commit b78859b

Please sign in to comment.