diff options
Diffstat (limited to 'examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py')
-rw-r--r-- | examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py b/examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py index 2cd37cda..29c480c1 100644 --- a/examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py +++ b/examples/v3arch/asyncore/manager/cmdgen/getbulk-multiple-oids-to-eom.py @@ -49,6 +49,7 @@ config.addTargetAddr( 'my-creds' ) + # Error/response receiver # noinspection PyUnusedLocal,PyUnusedLocal,PyUnusedLocal def cbFun(snmpEngine, sendRequesthandle, errorIndication, @@ -57,25 +58,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 ) |