Dynamic OIDs
Once the GoSNMPServer.NewSNMPServer, as far as I know, there is no way to update or change the OIDs list. In some cases, new entries should be added or removed.
Could be possible to add such capability? Can I help adding it?
I would be interested in a general solution as well. For now I did some crude changes for it in my fork.
Am 17.05.2024 um 10:44 schrieb Joan Duran:
Once the |GoSNMPServer.NewSNMPServer|, as far as I know, there is no way to update or change the OIDs list. In some cases, new entries should be added or removed.
Could be possible to add such capability? Can I help adding it?
— Reply to this email directly, view it on GitHub https://github.com/slayercat/GoSNMPServer/issues/31, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEALFRDAOMMDNHCTWIESOT3ZCW7QRAVCNFSM6AAAAABH3WZTX6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGMYDEMJVGU2DONA. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Why not determine all oids before the snmpServer run ?
Because we have a dynamic table, and the number of entries changes
Apologies, have logged practically the same issue, same essential outcome.
https://github.com/slayercat/GoSNMPServer/issues/42
Thank you for raising this issue. I sincerely apologize for not having had the energy to respond recently due to personal reasons.
The current OID generation follows an approach similar to the one implemented here: GoSNMPServer/networks.go.
As you can see, the lookup table must currently be pre-populated before starting. This is because when handling get-next requests, it needs to determine what the next OID should be. At present, a relatively simple method is used for this lookup process. Allowing dynamic changes would make the determination of the next entry significantly more complex.
Additionally, it appears that the same issue was encountered in GoSNMPServer Issue #39, where some action was taken previously. I am still looking forward to the next patch from @upsampled. It would be great if @upsampled could provide further assistance.
If you could describe your use case, I would greatly appreciate it. Understanding your requirements will help me better address the problem and refine the solution.
We need this feature to show the connections we have in our server, which can change with the time. But this feature can be used to show the files in a folder or similar things.
@slayercat , I have the core mechanism working. Just have not had time to write generic examples.
@jduranf I'll PR what I have, and explain how to use it. Basically it turns the existing OIDs into a cache layer. You just have to insert triggers to trigger the cache to be updated.
Here is what I am hoping, I push the OID generator code. Answer your questions and we get some initial example code (or changes) in this ticket that we push after
@upsampled for me looks like a good solution