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 | 13 |
1 files changed, 6 insertions, 7 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 1e49ffef..c30ff4c1 100644 --- a/examples/v3arch/asyncore/manager/cmdgen/custom-timeout-and-retries.py +++ b/examples/v3arch/asyncore/manager/cmdgen/custom-timeout-and-retries.py @@ -51,6 +51,7 @@ config.addTargetAddr( retryCount=5 ) + # Error/response receiver # noinspection PyUnusedLocal,PyUnusedLocal,PyUnusedLocal def cbFun(snmpEngine, sendRequestHandle, errorIndication, @@ -58,21 +59,19 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication, 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 oid, val in varBinds: print('%s = %s' % (oid.prettyPrint(), val.prettyPrint())) + # Prepare and send a request message cmdgen.GetCommandGenerator().sendVarBinds( snmpEngine, 'my-router', - None, '', # contextEngineId, contextName - [ ((1,3,6,1,2,1,1,1,0), None) ], + None, '', # contextEngineId, contextName + [((1, 3, 6, 1, 2, 1, 1, 1, 0), None)], cbFun ) |