I try solve this error, I can not find way.
I use windows 11.
also, I receaved error” no modeule “nextCmd”….
My code:
from pysnmp.hlapi import *
def snmp_walk(host, community, oid):
iterator = nextCmd(
SnmpEngine(),
CommunityData(community),
UdpTransportTarget((host, 161)),
ContextData(),
ObjectType(ObjectIdentity(oid)),
lexicographicMode=False
)
for (errorIndication, errorStatus, errorIndex, varBinds) in iterator:
if errorIndication:
print(f"Error: {errorIndication}")
break
elif errorStatus:
print(f"{errorIndex.prettyPrint()} {errorStatus.prettyPrint()}")
break
else:
for varBind in varBinds:
print(' = '.join([x.prettyPrint() for x in varBind]))
# Example usage
snmp_walk('172.2.225.22', '223wgw3R', '1.3.6.1.2.1.2.2.1.2')
change libraries version,
install other libraries