mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
PLUG: SNMPDSC timeout not respected #1231
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
@@ -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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user