I haven't installed the SMI module, so I used a dotted OID in place of the name:
for (errorIndication,
errorStatus,
errorIndex,
varBinds) in nextCmd(SnmpEngine(),
UsmUserData('usr-md5-none', 'authkey1'),
UdpTransportTarget(('1.1.1.1', 161)),
ContextData(),
ObjectType(ObjectIdentity('1.3.6.1.'))):
and I get:
python pull-whole-mib.py
Traceback (most recent call last):
File "pull-whole-mib.py", line 28, in
ObjectType(ObjectIdentity('1.3.6.1.'))):
File "/usr/lib/python2.7/site-packages/pysnmp/hlapi/asyncore/sync/cmdgen.py", line 360, in nextCmd
lookupMib=options.get('lookupMib', True)))
File "/usr/lib/python2.7/site-packages/pysnmp/hlapi/asyncore/cmdgen.py", line 356, in nextCmd
options.get('cbFun'), options.get('cbCtx'))
File "/usr/lib/python2.7/site-packages/pysnmp/entity/rfc3413/cmdgen.py", line 276, in sendVarBinds
reqPDU, cbFun, cbCtx))
File "/usr/lib/python2.7/site-packages/pysnmp/entity/rfc3413/cmdgen.py", line 189, in sendPdu
(sendRequestHandle, cbFun, cbCtx)
File "/usr/lib/python2.7/site-packages/pysnmp/proto/rfc3412.py", line 153, in sendPdu
pduVersion, PDU, expectResponse, sendPduHandle
File "/usr/lib/python2.7/site-packages/pysnmp/proto/mpmod/rfc3412.py", line 243, in prepareOutgoingMessage
securityEngineId, securityName, securityLevel, scopedPDU
File "/usr/lib/python2.7/site-packages/pysnmp/proto/secmod/rfc3414/service.py", line 525, in generateRequestMsg
None)
File "/usr/lib/python2.7/site-packages/pysnmp/proto/secmod/rfc3414/service.py", line 497, in generateRequestOrResponseMsg
authenticatedWholeMsg = encoder.encode(msg)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 102, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 588, in encodeValue
substrate += encodeFun(component, asn1Spec, **options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 86, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 696, in encodeValue
return encodeFun(component, asn1Spec, **options), True, True
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 102, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 588, in encodeValue
substrate += encodeFun(component, asn1Spec, **options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 86, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 696, in encodeValue
return encodeFun(component, asn1Spec, **options), True, True
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 102, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 588, in encodeValue
substrate += encodeFun(component, asn1Spec, **options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call__
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 102, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 676, in encodeValue
value, asn1Spec, encodeFun, **options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 650, in _encodeComponents
raise inconsistency
TypeError: exceptions must be old-style classes or derived from BaseException, not bool
I haven't installed the SMI module, so I used a dotted OID in place of the name:
and I get:
python pull-whole-mib.py Traceback (most recent call last): File "pull-whole-mib.py", line 28, in
ObjectType(ObjectIdentity('1.3.6.1.'))):
File "/usr/lib/python2.7/site-packages/pysnmp/hlapi/asyncore/sync/cmdgen.py", line 360, in nextCmd
lookupMib=options.get('lookupMib', True)))
File "/usr/lib/python2.7/site-packages/pysnmp/hlapi/asyncore/cmdgen.py", line 356, in nextCmd
options.get('cbFun'), options.get('cbCtx'))
File "/usr/lib/python2.7/site-packages/pysnmp/entity/rfc3413/cmdgen.py", line 276, in sendVarBinds
reqPDU, cbFun, cbCtx))
File "/usr/lib/python2.7/site-packages/pysnmp/entity/rfc3413/cmdgen.py", line 189, in sendPdu
(sendRequestHandle, cbFun, cbCtx)
File "/usr/lib/python2.7/site-packages/pysnmp/proto/rfc3412.py", line 153, in sendPdu
pduVersion, PDU, expectResponse, sendPduHandle
File "/usr/lib/python2.7/site-packages/pysnmp/proto/mpmod/rfc3412.py", line 243, in prepareOutgoingMessage
securityEngineId, securityName, securityLevel, scopedPDU
File "/usr/lib/python2.7/site-packages/pysnmp/proto/secmod/rfc3414/service.py", line 525, in generateRequestMsg
None)
File "/usr/lib/python2.7/site-packages/pysnmp/proto/secmod/rfc3414/service.py", line 497, in generateRequestOrResponseMsg
authenticatedWholeMsg = encoder.encode(msg)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 102, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 588, in encodeValue
substrate += encodeFun(component, asn1Spec, **options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 86, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 696, in encodeValue
return encodeFun(component, asn1Spec, **options), True, True
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 102, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 588, in encodeValue
substrate += encodeFun(component, asn1Spec, **options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 86, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 696, in encodeValue
return encodeFun(component, asn1Spec, **options), True, True
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 102, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 588, in encodeValue
substrate += encodeFun(component, asn1Spec, **options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 832, in call__
substrate = concreteEncoder.encode(value, asn1Spec, self, options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 102, in encode
value, asn1Spec, encodeFun, options
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 676, in encodeValue
value, asn1Spec, encodeFun, **options)
File "/usr/lib/python2.7/site-packages/pyasn1/codec/ber/encoder.py", line 650, in _encodeComponents
raise inconsistency
TypeError: exceptions must be old-style classes or derived from BaseException, not bool