diff options
Diffstat (limited to 'examples/hlapi/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py')
-rw-r--r-- | examples/hlapi/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py b/examples/hlapi/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py index 22fbe6de..f25fafe4 100644 --- a/examples/hlapi/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py +++ b/examples/hlapi/asyncore/sync/manager/cmdgen/custom-asn1-mib-search-path.py @@ -12,8 +12,7 @@ Send SNMP GET request using the following options: Functionally similar to: -| $ snmpget -v2c -c public -M /usr/share/snmp demo.snmplabs.com \ -| IF-MIB::ifInOctets.1 +| $ snmpget -v2c -c public -M /usr/share/snmp demo.snmplabs.com IF-MIB::ifInOctets.1 """# from pysnmp.hlapi import * @@ -23,17 +22,15 @@ errorIndication, errorStatus, errorIndex, varBinds = next( CommunityData('public'), UdpTransportTarget(('demo.snmplabs.com', 161)), ContextData(), - ObjectType(ObjectIdentity('IF-MIB', 'ifInOctets', 1).addAsn1MibSource('file:///usr/share/snmp', 'http://mibs.snmplabs.com/asn1/@mib@'))) + ObjectType(ObjectIdentity('IF-MIB', 'ifInOctets', 1).addAsn1MibSource('file:///usr/share/snmp', + 'http://mibs.snmplabs.com/asn1/@mib@'))) ) if errorIndication: print(errorIndication) elif errorStatus: - print('%s at %s' % ( - errorStatus.prettyPrint(), - errorIndex and varBinds[int(errorIndex)-1][0] or '?' - ) - ) + 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 ])) + print(' = '.join([x.prettyPrint() for x in varBind])) |