Use gosmi for SNMP traps#9307
Closed
loganmc10 wants to merge 1 commit intoinfluxdata:masterfrom
loganmc10:gosmi
Closed
Use gosmi for SNMP traps#9307loganmc10 wants to merge 1 commit intoinfluxdata:masterfrom loganmc10:gosmi
loganmc10 wants to merge 1 commit intoinfluxdata:masterfrom
loganmc10:gosmi
Conversation
Contributor
|
Thanks @loganmc10 for the PR. This is a good start To address the hardcoded path, on platforms that use net-snmp maybe we should use net-snmp's mib paths? We could have telegraf query net-snmp on startup with |
Contributor
Author
|
One of the benefits of this change would be to remove the dependency on net-snmp, so it would probably be better to either read the env variable MIBDIRS (which is what net-snmp uses), or add an option to the plugin that defaults to |
Contributor
Author
|
Closing in favour of #9343 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As requested in: #5720 (comment)
I'm submitting a very early implementation of using gosmi to translate SNMP OIDs for the snmp_trap plugin.
Using snmptranslate does not work well. It's slow to call it, and it requires a mutex lock to deal with the cache, which pretty much destroys any parallelism.
We ingest about 30 traps per second. Because of the varying OID index values coming in, the snmptranslate cache didn't really work as expected for us. Telegraf was pinned at 100% CPU usage.
I'm not a professional Go programmer and I'm not so great at unit tests. I'm hoping someone can take it from here and finish it off. We're using this implementation daily and it appears to work well for us. (less than 1% CPU usage from Telegraf to process those 30 traps/second).
The biggest shortfall of what I've upload here is that it uses a hardcoded path of
/usr/share/snmp/mibsfor the MIBs, it should probably be something that is configured as a plugin option. Also, the folder recursion is not very good, it doesn't go multiple levels into the folder structure.There is also a
gosmi.Exit()function that should be called to clean things up that I never implemented here.