We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code exemple in documentation is wrong for getCmd : https://pysnmp.readthedocs.io/en/latest/quick-start.html
It should be : `from pysnmp.hlapi import *
data = ( ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysLocation', 0)), ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr', 0)), )
iterator = getCmd( SnmpEngine(), CommunityData('public', mpModel=0), UdpTransportTarget(('demo.snmplabs.com', 161)), ContextData(), *data )
#errorIndication, errorStatus, errorIndex, varBinds = next(iterator) # wrong doc errorIndication, errorStatus, errorIndex, varBinds = iterator # fix
if errorIndication: print(errorIndication)
elif errorStatus: print('%s at %s' % (errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex) - 1][0] or '?'))
else: for varBind in varBinds: print(' = '.join([x.prettyPrint() for x in varBind])) `
The text was updated successfully, but these errors were encountered:
That's the wrong place to learn this project. Please use https://pysnmp.com
Read #429 to learn more.
Sorry, something went wrong.
Ok, I close this thread
No branches or pull requests
Code exemple in documentation is wrong for getCmd : https://pysnmp.readthedocs.io/en/latest/quick-start.html
It should be :
`from pysnmp.hlapi import *
data = (
ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysLocation', 0)),
ObjectType(ObjectIdentity('SNMPv2-MIB', 'sysDescr', 0)),
)
iterator = getCmd(
SnmpEngine(),
CommunityData('public', mpModel=0),
UdpTransportTarget(('demo.snmplabs.com', 161)),
ContextData(),
*data
)
#errorIndication, errorStatus, errorIndex, varBinds = next(iterator) # wrong doc
errorIndication, errorStatus, errorIndex, varBinds = iterator # fix
if errorIndication:
print(errorIndication)
elif errorStatus:
print('%s at %s' % (errorStatus.prettyPrint(),
errorIndex and varBinds[int(errorIndex) - 1][0] or '?'))
else:
for varBind in varBinds:
print(' = '.join([x.prettyPrint() for x in varBind]))
`
The text was updated successfully, but these errors were encountered: