Hi,
i have been trying to pull mac address information from Cisco Switch, with the code below:
oid = ObjectType(ObjectIdentity("1.3.6.1.2.1.17.4.3.1.1"))
next(nextCmd(
SnmpEngine(),
UsmUserData('username', authKey='pass', privKey='pass', authProtocol=usmHMACMD5AuthProtocol,
privProtocol=usmAesCfb128Protocol),
UdpTransportTarget((target, 161)),
ContextData(contextName='vlan-200'),
0, 25,
oid,
lexicographicMode=False,
))
but it throw the below error, i cant figure out what the issue is
Traceback (most recent call last):
File "C:/py_test_folder/test.py", line 115, in <module>
print(get_bulk_oid(host_name, mac_oid))
File "C:/py_test_folder/test.py", line 39, in get_bulk_oid
cdp_remote_host = next(nextCmd(
File "C:\Users\neteng\.virtualenvs\py_test_folder\lib\site-packages\pysnmp\hlapi\asyncore\sync\cmdgen.py", line 349, in nextCmd
initialVars = [x[0] for x in vbProcessor.makeVarBinds(snmpEngine, varBinds)]
File "C:\Users\neteng\.virtualenvs\py_test_folder\lib\site-packages\pysnmp\hlapi\varbinds.py", line 33, in makeVarBinds
elif isinstance(varBind[0], ObjectIdentity):
TypeError: 'int' object is not subscriptable
appreciate any help.
Hi,
i have been trying to pull mac address information from Cisco Switch, with the code below:
but it throw the below error, i cant figure out what the issue is
appreciate any help.