-
Notifications
You must be signed in to change notification settings - Fork 37
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
Question regarding uniqueness of node names #50
Comments
Node names only need to be unique per module, which is why |
Well I forgot to just google: https://stackoverflow.com/questions/59619704/must-object-names-descriptors-be-unique-within-an-snmp-mib-module basically confirms my assumption, it's not technically forbidden to use a duplicated entry name, but per the rfc it should be unique. |
It is not technically forbidden, but you're definitely going to have a bad time if it's not unique. For example, when linking a child node, which parent should it refer to? When importing a node from a module, which should it refer to? I have not tested this, but I believe the way the library would handle that at the moment is when linking inside of a module, it would use the most recently defined parent, so two nodes that refer to the same parent name could be part of different subtrees, and when importing it would use the last defined one, because it's looking up names in exactly the same way you are. In practice, I have not come across duplicates in the wild and a MIB file would certainly fail linting if it had duplicates, but based on all the other issues I've seen, there are a lot of companies that do not consistently lint their MIB files before releasing them, so ymmv. |
Well then I'm happy that my switch is conformant and everything works fine. Thank you very much for the explanation. |
I'm currently experimenting with gosnmp and gosmi to write a terraform module for my dlink dgs 1210-24 switch, so far I'm able to set single values by looking up the oid and then passing the oid to gosnmp using e.g.
gosmi.GetNode("sysSwitchName")
and I got the right oids for the values I'm setting, however I'm wondering what happens if I had two nodes with the same name but in another subtree, to mitigate that I tried passing the full path ofcompanySystem.sysSwitchName
toGetNode()
but then I couldn't find the node.Is it possible to get an oid by full path instead, if not, how can I make sure that I get the right node. In the mib of my switch there are no duplicate nodes, but eventually I want the terraform module to be as generic as possible, so I want to avoid errors when using other mib that are currently unknown to me.
The text was updated successfully, but these errors were encountered: