GoSNMPServer icon indicating copy to clipboard operation
GoSNMPServer copied to clipboard

Dynamic OIDs

Open jduranf opened this issue 1 year ago • 8 comments

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?

jduranf avatar May 17 '24 08:05 jduranf

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: @.***>

marcushorstmann avatar May 17 '24 10:05 marcushorstmann

Why not determine all oids before the snmpServer run ?

feng99 avatar Dec 11 '24 02:12 feng99

Because we have a dynamic table, and the number of entries changes

jduranf avatar Dec 11 '24 07:12 jduranf

Apologies, have logged practically the same issue, same essential outcome.

https://github.com/slayercat/GoSNMPServer/issues/42

gawie-kellerman avatar Nov 03 '25 14:11 gawie-kellerman

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.

slayercat avatar Nov 10 '25 04:11 slayercat

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.

jduranf avatar Nov 10 '25 08:11 jduranf

@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 avatar Nov 10 '25 14:11 upsampled

@upsampled for me looks like a good solution

jduranf avatar Nov 10 '25 14:11 jduranf