From 170aeb041f31c3904a00f6040e71830de009e996 Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Sat, 25 Oct 2025 13:48:56 +1100 Subject: [PATCH] PLUG: SNMPDSC timeout not respected #1231 Signed-off-by: jokob-sk --- front/plugins/snmp_discovery/script.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/front/plugins/snmp_discovery/script.py b/front/plugins/snmp_discovery/script.py index 149330f1..ad25d01d 100755 --- a/front/plugins/snmp_discovery/script.py +++ b/front/plugins/snmp_discovery/script.py @@ -42,6 +42,8 @@ def main(): parser.add_argument('routers', action="store", help="IP(s) of routers, separated by comma (,) if passing multiple") values = parser.parse_args() + timeoutSetting = get_setting_value("SNMPDSC_RUN_TIMEOUT") + plugin_objects = Plugin_Objects(RESULT_FILE) if values.routers: @@ -55,16 +57,14 @@ def main(): for cmd in commands: mylog('verbose', ['[SNMPDSC] Router snmpwalk command: ', cmd]) - timeoutSec = 10 # split the string, remove white spaces around each item, and exclude any empty strings snmpwalkArgs = [arg.strip() for arg in cmd.split(' ') if arg.strip()] - # Execute N probes and insert in list probes = 1 # N probes for _ in range(probes): - output = subprocess.check_output (snmpwalkArgs, universal_newlines=True, stderr=subprocess.STDOUT, timeout=(timeoutSec )) + output = subprocess.check_output (snmpwalkArgs, universal_newlines=True, stderr=subprocess.STDOUT, timeout=(timeoutSetting)) mylog('verbose', ['[SNMPDSC] output: ', output])