Skip to content
Snippets Groups Projects
Commit 537e76b4 authored by David Schmitz's avatar David Schmitz
Browse files

fix/snmp_bulk_params: make SNMP_BULK_GET__NON_REPEATERS and...

fix/snmp_bulk_params: make SNMP_BULK_GET__NON_REPEATERS and SNMP_BULK_GET__MAX_REPETITIONS parameters in settings
parent e8461149
No related branches found
No related tags found
No related merge requests found
...@@ -142,9 +142,21 @@ def get_snmp_stats(): ...@@ -142,9 +142,21 @@ def get_snmp_stats():
snmpEngine = SnmpEngine() snmpEngine = SnmpEngine()
##
try:
snmp_bulk_get__non_repeaters = settings.SNMP_BULK_GET__NON_REPEATERS
except Exception as e:
snmp_bulk_get__non_repeaters = 0
try:
snmp_bulk_get__max_repetitions = settings.SNMP_BULK_GET__MAX_REPETITIONS
except Exception as e:
snmp_bulk_get__max_repetitions = 10
# Submit initial GETNEXT requests and wait for responses # Submit initial GETNEXT requests and wait for responses
for authData, transportTarget, varBinds in targets: for authData, transportTarget, varBinds in targets:
bulkCmd(snmpEngine, authData, transportTarget, ContextData(), 0, 50, bulkCmd(snmpEngine, authData, transportTarget, ContextData(), snmp_bulk_get__non_repeaters, snmp_bulk_get__max_repetitions,
*varBinds, **dict(cbFun=snmpCallback, cbCtx=(authData, transportTarget.transportAddr, results))) *varBinds, **dict(cbFun=snmpCallback, cbCtx=(authData, transportTarget.transportAddr, results)))
snmpEngine.transportDispatcher.runDispatcher() snmpEngine.transportDispatcher.runDispatcher()
......
...@@ -560,6 +560,9 @@ NETCONF_PORT = 830 ...@@ -560,6 +560,9 @@ NETCONF_PORT = 830
# Default community string # Default community string
SNMP_COMMUNITY = "abcd" SNMP_COMMUNITY = "abcd"
SNMP_BULK_GET__MAX_REPETITIONS = 10
SNMP_BULK_GET__NON_REPEATERS = 0
# list of IP addresses, each IP is a dict with "ip", "port" (optional, default # list of IP addresses, each IP is a dict with "ip", "port" (optional, default
# is 161), "community" (optional, default is SNMP_COMMUNITY) keys # is 161), "community" (optional, default is SNMP_COMMUNITY) keys
SNMP_IP = [ SNMP_IP = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment