-
Notifications
You must be signed in to change notification settings - Fork 634
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 RFC 3430 #555
Comments
++ for that feature request |
Today I realised that we might need this feature and I am willing to implement it, if there is still interest for it. Indeed the gosnmp library supports setting Given that this is pretty much settable together with |
Not something for a query parameter, but should be part of the |
Hi @SuperQ , thanks for replying! Transport (and In my humble opinion, transport should be actually part of
For example in Net SNMP (manpage - Agent Specification section), the syntax is Or in Keepalived (manpage - Perhaps the SNMP Exporter should also use |
The I would be in favor of URL handling here, since we can do simple operations like:
Might be worth breaking out the |
Yes, I'm aware of the This brings me another follow-up design question. Instead of hard-coding specific transports (udp/tcp), the gosnmp library can actually work with a wider range of transports than only udp/tcp. In fact, another very common transport are Unix sockets.
If we do proper URL parsing, we can then pass any scheme provided in
I fully agree with that idea and considering the above, I suggest on a function like this: func parseTarget(target string) (*url.URL, error) {
// The ugly part here is backwards compatibility.
// If "target" does not have a scheme:// then we should add a default udp:// one to "target" before parsing.
// This would require a regex prefix matching if we go the "generalized" route or
// use simple rule-matching for all the supported schemes.
return url.ParseRequestURI(target)
} Then the collector can easily extract the parts or error out if target is invalid: u, err := parseTarget(target)
transport := u.Scheme
host := u.Hostname()
port := u:Port() What do you think? |
Yea, that kind of complexity is why I would prefer to have it be part of the config. In our new config system we can do something like this: auths:
tcp_public_v2:
community: public
version: 2
transport: tcp We can then pass in all of the transport options directly. But, we could also go with |
I really don't think is a good idea to mix dynamic transport configuration with static authentication configs.
Yeah maybe that is a good idea indeed, to not assume a "general URL" and avoid formal URL parsing which can get tricky. Basically the contract for the If you are okay with that, I am happy to implement this. |
Sounds like a good plan to me. |
While it's not common, some devices do support RFC 3430, SNMP over TCP. The upstream gosnmp library supports this, so it should be an easy thing to add.
The text was updated successfully, but these errors were encountered: