-
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
Support for SNMP over TCP #5870
Conversation
@@ -488,6 +488,14 @@ | |||
revision = "636bf0302bc95575d69441b25a2603156ffdddf1" | |||
version = "v1.1.1" | |||
|
|||
[[projects]] | |||
digest = "1:530233672f656641b365f8efb38ed9fba80e420baff2ce87633813ab3755ed6d" | |||
name = "github.com/golang/mock" |
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 see this is a new dependency of gosnmp, maybe if it were generated into the gosnmp_test package we wouldn't need this testing dep? I'd like to have someone look into if this is possible before updating gosnmp.
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 understand that you do not want to include this testing dep, but I am not sure how to fix this.
The new version of gosnmp does have support for SNMP over TCP.
Agents prefixed with 'tcp://' do now get their transport protocol set to TCP. gosnmp handles all the details.
Add a new test to verify that agents prefixed with tcp: use the correct transport protocol. As getConnection does the full connection setup, we need a server listening on the port to allow the test to pass. This server is therefore also set up in the test. Also verify that the other agents still use UDP.
Sorry about stranding this PR for so long, while I'd still love the gomock dependency removed it's not enough to hold up this PR. |
While SNMP is usually done over UDP, it is possible to transport it using TCP. This is specified in RFC 3430 and should be used when transferring lots of data.
This PR adds support for SNMP over TCP to telegraf. The heavy lifting is done by the gosnmp library. Therefore it was only necessary to set the transport protocol for the agents, that should be gathered via TCP. To use it, you have to configure an agent like this:
The notation of prefixing withtcp:
has been taken from net-snmp which uses it for their command line tools like snmpbulkwalk.Required for all PRs: