Skip to content

Commit

Permalink
Remove read_failed state from TCP prober
Browse files Browse the repository at this point in the history
Fix typo in README

Remove deprecated comments

Tweak
  • Loading branch information
Bob Shannon committed Jul 13, 2017
1 parent f495f08 commit 530ac6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugins/inputs/net_response/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ It can also check response text.
- net_response
- response_time (float, seconds)
- result_type (string) # success, timeout, connection_failed, read_failed, string_mismatch
- [**DEPRECATED**] string_mismatch (boolean)
- [**DEPRECATED**] string_found (boolean)

### Tags:

Expand Down
6 changes: 3 additions & 3 deletions plugins/inputs/net_response/net_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (n *NetResponse) TcpGather() (map[string]interface{}, error) {
responseTime = time.Since(start).Seconds()
// Handle error
if err != nil {
fields["result_type"] = "read_failed"
fields["result_type"] = "string_mismatch"
} else {
// Looking for string in answer
RegEx := regexp.MustCompile(`.*` + n.Expect + `.*`)
Expand Down Expand Up @@ -153,10 +153,10 @@ func (n *NetResponse) UdpGather() (map[string]interface{}, error) {
find := RegEx.FindString(string(buf))
if find != "" {
fields["result_type"] = "success"
fields["string_found"] = true // WARNING: This field will be deprecated in a future release.
fields["string_found"] = true
} else {
fields["result_type"] = "string_mismatch"
fields["string_found"] = false // WARNING: This field will be deprecated in a future release.
fields["string_found"] = false
}
}
fields["response_time"] = responseTime
Expand Down

0 comments on commit 530ac6f

Please sign in to comment.