diff options
Diffstat (limited to 'examples/v3arch/asyncore/manager/cmdgen/custom-timeout-and-retries.py')
-rw-r--r-- | examples/v3arch/asyncore/manager/cmdgen/custom-timeout-and-retries.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/v3arch/asyncore/manager/cmdgen/custom-timeout-and-retries.py b/examples/v3arch/asyncore/manager/cmdgen/custom-timeout-and-retries.py index 45b8c7a6..b7e137b3 100644 --- a/examples/v3arch/asyncore/manager/cmdgen/custom-timeout-and-retries.py +++ b/examples/v3arch/asyncore/manager/cmdgen/custom-timeout-and-retries.py @@ -43,6 +43,7 @@ config.addTransport( udp.DOMAIN_NAME, udp.UdpSocketTransport().openClientMode() ) + config.addTargetAddr( snmpEngine, 'my-router', udp.DOMAIN_NAME, ('104.236.166.95', 161), @@ -58,9 +59,11 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication, errorStatus, errorIndex, varBinds, cbCtx): if errorIndication: print(errorIndication) + elif errorStatus: print('%s at %s' % (errorStatus.prettyPrint(), errorIndex and varBinds[int(errorIndex) - 1][0] or '?')) + else: for oid, val in varBinds: print('%s = %s' % (oid.prettyPrint(), val.prettyPrint())) |