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/fetch-variables-over-ipv6.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/fetch-variables-over-ipv6.py')
-rw-r--r-- | examples/v3arch/asyncore/manager/cmdgen/fetch-variables-over-ipv6.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/v3arch/asyncore/manager/cmdgen/fetch-variables-over-ipv6.py b/examples/v3arch/asyncore/manager/cmdgen/fetch-variables-over-ipv6.py index 0a156d0f..de85e3db 100644 --- a/examples/v3arch/asyncore/manager/cmdgen/fetch-variables-over-ipv6.py +++ b/examples/v3arch/asyncore/manager/cmdgen/fetch-variables-over-ipv6.py @@ -44,6 +44,7 @@ config.addTransport( udp6.DOMAIN_NAME, udp6.Udp6SocketTransport().openClientMode() ) + config.addTargetAddr( snmpEngine, 'my-router', udp6.DOMAIN_NAME, ('::1', 161), @@ -58,13 +59,17 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication, if errorIndication: print(errorIndication) return + if errorStatus: print('%s at %s' % (errorStatus.prettyPrint(), errorIndex and varBindTable[-1][int(errorIndex) - 1][0] or '?')) return # stop on error + for varBindRow in varBindTable: + for oid, val in varBindRow: print('%s = %s' % (oid.prettyPrint(), val.prettyPrint())) + return True # signal dispatcher to continue |