-
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
Snmp strip components #4025
Snmp strip components #4025
Conversation
@ragzilla I don't entirely understand the existing |
Sure, oid_index_suffix is used when the SNMP agent appends an additional value (usually a sub-index) after the actual indexed value:
In this example, we have a fixed MIB determined sub-index. This is the most typical case seen in SNMP agents in the wild. Some vendors in their infinite wisdom occasionally decide to introduce a varying sub-index (usually relating to an index elsewhere in the MIB):
The sub-index in this case isn't useful or worth capturing, but since it varies, it can't be handled with the current oid_index_suffix code path. Both options have their use cases. The oid_index_suffix could actually have some optimization done to it (since right now to capture multiple sub-indices under a primary SNMP index you have to run multiple parallel gets on the tree). |
Thanks, that is very helpful. This looks good to me, @phemmer can you also review? |
This smells a bit like the string indexing technique, where the OID suffix is the ASCII representation of a string. E.G. "foobar" is Edit: Looking at it some more, I think I am leaning towards specifying the index length, instead of the suffix-discard length. In your case, the index length would be 1 (the |
Similar, in this case it's an additional integer suffix for the ISIS circuit ID (local to the box, and subject to change if the ISIS process restarts so not worth tracking). I'll look at rewriting to a max_index_length (in oid path segments) based approach as that'll cover my use case as well as the ASCII trailer (or other random binary junk) use cases. |
Adds an oid_strip_index_components option to the snmp input to allow for stripping variable trailing OID sub-indexes (e.g. CISCO-IETF-ISIS-MIB L2 circuits)
Required for all PRs: