Skip to content

A collection of IETF & IANA & Cisco & Juniper & Arista & Aruba & Perle MIBs pre-compiled for PySNMP

Notifications You must be signed in to change notification settings

oriordan/pysnmp_mibs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

pysnmp_mibs

A collection of IETF & IANA & network vendor specific MIBs pre-compiled for PySNMP

pysnmp and pyasn1 are great libraries for working with SNMP in Python. Ilya Etingof (the author of the above projects) made a pypi package called pysnmp-mibs, which contains standard mibs, however if you need to work with some proprietary network hardware, you'll need to compile your own files. The process is not always straightforward, and this repo supposed to help you getting there in an easier way.

##Vendor resources:

##Usage:

> git clone https://github.com/oriordan/pysnmp_mibs/
> python
>>> from pyasn1.type import univ
>>> from pysnmp.entity.rfc3413.oneliner.mibvar import MibVariable
>>> from pysnmp.smi import builder, view
>>> mibBuilder = builder.MibBuilder().loadModules('SNMPv2-MIB')
>>> mibViewController = view.MibViewController(mibBuilder)
>>> x = MibVariable(univ.ObjectIdentifier('1.3.6.1.2.1.1.1')).resolveWithMib(mibViewController)
>>> x.getLabel()
('iso', 'org', 'dod', 'internet', 'mgmt', 'mib-2', 'system', 'sysDescr')
>>>

##Hints:

Sometimes network devices are not sending the traps according to their own MIB specification. In order to minimize OID resolution issues, some compiled mibs are altered:

  • IF-MIB.py: Allowing zero interface index (because Cisco voice gateways are "special")
  • BGP4-V2-MIB-JUNIPER.py: Using InetAddressIPv6 for jnxBgpM2PeerLocalAddr and jnxBgpM2PeerRemoteAddr
  • CISCO-BGP4-MIB.py: Dropping cbgpPeer2Type from cbgpPeer2Entry
  • CISCO-DIAL-CONTROL-MIB.py: Using Integer for cCallHistoryConnectTime and cCallHistoryDisconnectTime

About

A collection of IETF & IANA & Cisco & Juniper & Arista & Aruba & Perle MIBs pre-compiled for PySNMP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages