I want to write the snmp script on Python, but prior to that I want to understand snmp oid's.
For example, I need oid for dot1x and when I issue 'show snmp mibs' command on cisco switch, it shows me several dot1x mibs, but when I do snmpwalk on that device I don't see any oid related to dot1x.
My snmpwalk command shows me oids that start only with 1.3.6, but "Cisco snmp object navigator" shows me oids related to dot1x that start with 1.1.8802
I'm totally confused
Start here: https://mibs.cloudapps.cisco.com/ITDIT/MIBS/servlet/index to find the MIBs relevant to your hardware and OS type & version.
You said you're interested in 802.1x but you didn't specify the model of your switch so you could be looking at a different MIB for IOS vs IOS XE. However, 802.1x is usually handled by the CISCO-PAE-MIB.my
file (Port Access Entity) which you can download here: ftp://ftp.cisco.com/pub/mibs/v2/CISCO-PAE-MIB.my.
Here's two OIDs to help get you started but keep in mind I've picked the MIB that is generally supported on Cisco mainstream switches. You could have a switch that requires a different MIB (and thus uses different OIDs). The MIB locator tool I gave you will help you find the right ones.
1.3.6.1.4.1.9.9.220
is the base OID for the the PAE MIB.1.3.6.1.4.1.9.9.220.1
is probably where you're going be interested in (cpaeMIBObject). This OID contains the objects & children directly related the configuration and monitoring of 802.1x. If you walk this OID, you should get quite a bit of information.There is another MIB (IEEE8021-PAE-MIB) that is not Cisco specific but many Cisco switches do support it. You can download that MIB here: ftp://ftp.cisco.com/pub/mibs/v2/IEEE8021-PAE-MIB.my
1.0.8802.1.1.1
is the base OID for this MIB.1.0.8802.1
is the parent OID that encompases IEEE 802.1xYou didn't specify what information you're looking for and these MIB contain quite a bit so you might need to figure out what each OID offers and what you're interested in collecting.
** Also, get a MIB browser! There are many out there and they will help you keep your sanity when you're parsing the seemingly endless MIB hierarchies.