Skip to content
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

Two different MIBs with the same scalar name #36

Closed
rminsk opened this issue Jul 9, 2015 · 3 comments
Closed

Two different MIBs with the same scalar name #36

rminsk opened this issue Jul 9, 2015 · 3 comments

Comments

@rminsk
Copy link

rminsk commented Jul 9, 2015

I have two different MIBs with the same scalar name that I need to load. Is there a way to prefix the scalar name with the module name?

We have a.mib and b.mib and they both have the scalar 'foo'. What would happen if we do
snimpy.manager.load('a.mib') followed by snimpy.manager.load('b.mib')? What would happen if I loaded them in the other order? Could you add manager['A-MIB::foo']? Or manager['A-MIB'].foo?

@vincentbernat
Copy link
Owner

The second syntax would be possible to implement. I'll try to do that.

@vincentbernat
Copy link
Owner

I have implemented the second syntax you proposed. Please, try.

@rminsk
Copy link
Author

rminsk commented Jul 9, 2015

Seems to be working. A side effect is a small optimization. If you are accessing lots of scalars from the same module. You can limit to searching only oids in the single module.

restricted_manager = manager['A-MIB']
restricted_manager.foo = 1
print restricted_manager.bar
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants