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

Missed a few deprecated warnings
  • Loading branch information
Bob Shannon committed Jul 13, 2017
1 parent f495f08 commit 925eeef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 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
10 changes: 5 additions & 5 deletions plugins/inputs/net_response/net_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ 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 + `.*`)
find := RegEx.FindString(string(data))
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
}
}
} else {
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 925eeef

Please sign in to comment.