diff options
author | Ilya Etingof <etingof@gmail.com> | 2019-02-12 09:16:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-12 09:16:17 +0100 |
commit | b9a7b9c955df98b1e5eec250f418c3df3b7d0199 (patch) | |
tree | 3364eb15031352859586e8eb6aa49759a23f9c72 /examples/v3arch/asyncore/manager/cmdgen/getnext-multiple-oids-and-resolve-with-mib.py | |
parent | c5f7842c430ad3431bee793362ef11cff9f1e0de (diff) | |
download | pysnmp-git-b9a7b9c955df98b1e5eec250f418c3df3b7d0199.tar.gz |
Reformat example scripts for easier reading (#241)
Diffstat (limited to 'examples/v3arch/asyncore/manager/cmdgen/getnext-multiple-oids-and-resolve-with-mib.py')
-rw-r--r-- | examples/v3arch/asyncore/manager/cmdgen/getnext-multiple-oids-and-resolve-with-mib.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/v3arch/asyncore/manager/cmdgen/getnext-multiple-oids-and-resolve-with-mib.py b/examples/v3arch/asyncore/manager/cmdgen/getnext-multiple-oids-and-resolve-with-mib.py index f01efec7..8fed28c1 100644 --- a/examples/v3arch/asyncore/manager/cmdgen/getnext-multiple-oids-and-resolve-with-mib.py +++ b/examples/v3arch/asyncore/manager/cmdgen/getnext-multiple-oids-and-resolve-with-mib.py @@ -54,6 +54,7 @@ config.addTransport( udp.DOMAIN_NAME, udp.UdpSocketTransport().openClientMode() ) + config.addTargetAddr( snmpEngine, 'my-router', udp.DOMAIN_NAME, ('104.236.166.95', 161), @@ -68,17 +69,20 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication, if errorIndication: print(errorIndication) return + # SNMPv1 response may contain noSuchName error *and* SNMPv2c exception, # so we ignore noSuchName error here if errorStatus and errorStatus != 2: print('%s at %s' % (errorStatus.prettyPrint(), errorIndex and varBindTable[-1][int(errorIndex) - 1][0] or '?')) return # stop on error + for varBindRow in varBindTable: for varBind in varBindRow: print(rfc1902.ObjectType(rfc1902.ObjectIdentity(varBind[0]), varBind[1]).resolveWithMib(mibViewController).prettyPrint()) - return 1 # signal dispatcher to continue + + return True # signal dispatcher to continue # Prepare initial request to be sent |