diff options
Diffstat (limited to 'examples/v3arch/asyncore/manager/cmdgen/v2c-set.py')
-rw-r--r-- | examples/v3arch/asyncore/manager/cmdgen/v2c-set.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/v3arch/asyncore/manager/cmdgen/v2c-set.py b/examples/v3arch/asyncore/manager/cmdgen/v2c-set.py index 61657677..8e6a1168 100644 --- a/examples/v3arch/asyncore/manager/cmdgen/v2c-set.py +++ b/examples/v3arch/asyncore/manager/cmdgen/v2c-set.py @@ -42,6 +42,7 @@ config.addTransport( udp.DOMAIN_NAME, udp.UdpSocketTransport().openClientMode() ) + config.addTargetAddr( snmpEngine, 'my-router', udp.DOMAIN_NAME, ('104.236.166.95', 161), @@ -55,9 +56,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())) |