diff options
Diffstat (limited to 'examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py')
-rw-r--r-- | examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py index 759171c1..20767556 100644 --- a/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py +++ b/examples/hlapi/v1arch/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py @@ -18,16 +18,19 @@ Functionally similar to: """# from pysnmp.hlapi.v1arch import * -errorIndication, errorStatus, errorIndex, varBinds = next( - getCmd(SnmpDispatcher(), - CommunityData('public'), - UdpTransportTarget(('demo.snmplabs.com', 161)), - ObjectType(ObjectIdentity('IF-MIB', 'ifInOctets', 1).addAsn1MibSource( - 'file:///usr/share/snmp', - 'http://mibs.snmplabs.com/asn1/@mib@')), - lookupMib=True) +iterator = getCmd( + SnmpDispatcher(), + CommunityData('public'), + UdpTransportTarget(('demo.snmplabs.com', 161)), + ObjectType(ObjectIdentity('IF-MIB', 'ifInOctets', 1).addAsn1MibSource( + 'file:///usr/share/snmp', + 'http://mibs.snmplabs.com/asn1/@mib@') + ), + lookupMib=True ) +errorIndication, errorStatus, errorIndex, varBinds = next(iterator) + if errorIndication: print(errorIndication) |