-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose v4/v6-only connection-schemes through GosnmpWrapper #8804
Changes from 7 commits
7331092
0d55e69
9dc2dc1
0482f17
cc1bc50
f60dfdc
40ffa63
3e15db8
bdc99ef
4953f2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -22,8 +22,13 @@ information. | |||||
```toml | ||||||
[[inputs.snmp]] | ||||||
## Agent addresses to retrieve values from. | ||||||
## format: agents = ["<scheme://><hostname>:<port>"] | ||||||
## scheme: optional, either udp, udp4, udp6, tcp, tcp4, tcp6. | ||||||
## default is udp | ||||||
## port: optional | ||||||
## example: agents = ["udp://127.0.0.1:161"] | ||||||
## agents = ["tcp://127.0.0.1:161"] | ||||||
## agents = ["udpv4://v4only-snmp-agent"] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there an extra "v" in the scheme in this example?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, good catch! |
||||||
agents = ["udp://127.0.0.1:161"] | ||||||
|
||||||
## Timeout for each request. | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,13 @@ import ( | |
const description = `Retrieves SNMP values from remote agents` | ||
const sampleConfig = ` | ||
## Agent addresses to retrieve values from. | ||
## format: agents = ["<scheme://><hostname>:<port>"] | ||
## scheme: optional, either udp, udp4, udp6, tcp, tcp4, tcp6. | ||
## default is udp | ||
## port: optional | ||
## example: agents = ["udp://127.0.0.1:161"] | ||
## agents = ["tcp://127.0.0.1:161"] | ||
## agents = ["udpv4://v4only-snmp-agent"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extra v here too There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uhhh. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's what reviews are for! Hey I noticed you said you're just getting started with go. If you're looking for more opportunities to write go code, feel free to grab issues with the "enhancement" or "good first issue" label. The influx and community devs and I are happy to give you feedback on PRs. Thanks again for this PR! |
||
agents = ["udp://127.0.0.1:161"] | ||
|
||
## Timeout for each request. | ||
|
@@ -560,7 +565,8 @@ func (s *Snmp) getConnection(idx int) (snmpConnection, error) { | |
if err != nil { | ||
return nil, err | ||
} | ||
gs.SetAgent(agent) | ||
|
||
err = gs.SetAgent(agent) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep the
tcp
example.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have re-added the example.