Module: check_mk
Branch: master
Commit: 2af16afd57b62a30fe804336ac643f6b51c5c82d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2af16afd57b62a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Mar 3 12:12:36 2015 +0100
#2050 FIX netapp_api_if: Fixed invalid speed warning for virtual interface groups
The check incorrectly reported "Interfaces do not have the same speed" when
multiple virtual interfaces shared the same MAC address.
---
.werks/2050 | 12 ++++++++++++
ChangeLog | 1 +
checks/netapp_api_if | 13 +++++++------
3 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/.werks/2050 b/.werks/2050
new file mode 100644
index 0000000..744574d
--- /dev/null
+++ b/.werks/2050
@@ -0,0 +1,12 @@
+Title: netapp_api_if: Fixed invalid speed warning for virtual interface groups
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1425381040
+
+The check incorrectly reported "Interfaces do not have the same speed" when
+multiple virtual interfaces shared the same MAC address.
+
diff --git a/ChangeLog b/ChangeLog
index 165f7d4..47f18ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -215,6 +215,7 @@
* 2079 FIX: freebsd agent: Was unable to find ntpq command with FreeBSD10...
* 2082 FIX: jolokia_metrics.mem: Fixed levels on total memory usage
* 2049 FIX: window agents: prevent errors with invalid plugin output...
+ * 2050 FIX: netapp_api_if: Fixed invalid speed warning for virtual interface
groups...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/netapp_api_if b/checks/netapp_api_if
index e6de141..a267db2 100644
--- a/checks/netapp_api_if
+++ b/checks/netapp_api_if
@@ -100,8 +100,6 @@ def netapp_convert_to_if64(info):
# speed as the virtual speed. Note: Depending on the configuration this behaviour
might
# differ, e.g. the speed of all interfaces might get accumulated..
# Additionally, we check if not all interfaces of the virtual group share the
same connection speed
- max_speed = 0
- min_speed = 0
if not speed:
if "mac-address" in values:
mac_list = if_mac_list[values["mac-address"]]
@@ -109,13 +107,16 @@ def netapp_convert_to_if64(info):
extra_info.setdefault(nic_name, {})
extra_info[nic_name]["grouped_if"] = [ x for x in mac_list
if x not in vif_list ]
+ max_speed = 0
+ min_speed = 1024**5
for tmp_if in mac_list:
- if tmp_if == nic_name:
+ if tmp_if == nic_name or "speed" not in
interfaces[tmp_if]:
continue
- max_speed = max(max_speed,
interfaces[tmp_if].get("speed", 0))
- min_speed = min(max_speed,
interfaces[tmp_if].get("speed", 0))
+ check_speed = interfaces[tmp_if]["speed"]
+ max_speed = max(max_speed, check_speed)
+ min_speed = min(min_speed, check_speed)
if max_speed != min_speed:
- extra_info[nic_name]["speed_differs"] = True
+ extra_info[nic_name]["speed_differs"] = (max_speed,
min_speed)
speed = max_speed
# Virtual interfaces is "Up" if at least one physical interface is up