From ca91be51e18feb96b7ae10ec927d937edf3dbe18 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 14 Feb 2023 15:49:58 -0500 Subject: [PATCH] Improve ethtool parsing speeds --- node-daemon/plugins/nics | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node-daemon/plugins/nics b/node-daemon/plugins/nics index 3edc4dec..70840245 100644 --- a/node-daemon/plugins/nics +++ b/node-daemon/plugins/nics @@ -69,7 +69,7 @@ class MonitoringPluginScript(MonitoringPlugin): # Run any imports first import daemon_lib.common as common - from re import match, search + from re import match, search, findall messages = list() health_delta = 0 @@ -150,7 +150,7 @@ class MonitoringPluginScript(MonitoringPlugin): in_modes = False break if in_modes: - speed = int(line.split()[-1].replace('baseT', '').split('/')[0]) + speed = int(findall(r'\d+', line.split()[-1])[0]) supported_link_speeds.add(speed) else: # Get ethtool supported speeds for interface