diff options
Diffstat (limited to 'examples/v3arch/asyncore/manager/cmdgen/getbulk-fetch-scalar-and-table-variables.py')
-rw-r--r-- | examples/v3arch/asyncore/manager/cmdgen/getbulk-fetch-scalar-and-table-variables.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/examples/v3arch/asyncore/manager/cmdgen/getbulk-fetch-scalar-and-table-variables.py b/examples/v3arch/asyncore/manager/cmdgen/getbulk-fetch-scalar-and-table-variables.py index 516951f8..8c4bf3dd 100644 --- a/examples/v3arch/asyncore/manager/cmdgen/getbulk-fetch-scalar-and-table-variables.py +++ b/examples/v3arch/asyncore/manager/cmdgen/getbulk-fetch-scalar-and-table-variables.py @@ -52,6 +52,7 @@ config.addTargetAddr( 'my-creds' ) + # Error/response receiver # noinspection PyUnusedLocal,PyUnusedLocal,PyUnusedLocal def cbFun(snmpEngine, sendRequesthandle, errorIndication, @@ -60,25 +61,23 @@ def cbFun(snmpEngine, sendRequesthandle, errorIndication, print(errorIndication) return # stop on error if errorStatus: - print('%s at %s' % ( - errorStatus.prettyPrint(), - errorIndex and varBindTable[-1][int(errorIndex)-1][0] or '?' - ) - ) + 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 walking + return True # signal dispatcher to continue walking + # Prepare initial request to be sent cmdgen.BulkCommandGenerator().sendVarBinds( snmpEngine, 'my-router', None, '', # contextEngineId, contextName - 0, 25, # non-repeaters, max-repetitions - ( ((1,3,6,1,2,1,1), None), - ((1,3,6,1,4,1,1), None) ), + 0, 25, # non-repeaters, max-repetitions + (((1, 3, 6, 1, 2, 1, 1), None), + ((1, 3, 6, 1, 4, 1, 1), None)), cbFun ) |