how to load and walk a custom mib in pysnmp?

天大地大妈咪最大 提交于 2019-12-04 15:29:01
Pooh

Do you really need to use non-default ContextEngineId & ContextName? If not, I'd advise using this example instead. You could load your custom MIB into default SnmpEngine's MIB tree (mibBuilder) which is available through these calls:

snmpContext = context.SnmpContext(snmpEngine)
mibBuilder = snmpContext.getMibInstrum().getMibBuilder()

Also make sure you allow Manager access to your OIDs using config.addVacmUser() function.

Another important thing to realize is that compiled pysnmp MIB in its initial state does not contain instances of MIB variables, rather it only gives hints to a Manager regarding Agent's contents. Therefore to make your Agent live you would have to add instances of Managed Objects into your MIB what is explained in another example.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!