Module: check_mk
Branch: master
Commit: 2eb43b69693f548c7894feab5e62f8f507dad7e8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2eb43b69693f54…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Dec 15 13:37:20 2014 +0100
#1663 FIX winperf_if: fixed incorrect enumeration of interface index
The previous update broke services, which used the interface index as item.
This has been fixed.
---
.werks/1663 | 11 +++++++++++
ChangeLog | 1 +
checks/winperf_if | 6 +++---
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/.werks/1663 b/.werks/1663
new file mode 100644
index 0000000..59bc02a
--- /dev/null
+++ b/.werks/1663
@@ -0,0 +1,11 @@
+Title: winperf_if: fixed incorrect enumeration of interface index
+Level: 2
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1418646805
+
+The previous update broke services, which used the interface index as item.
+This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index c572ca5..b743f34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
* 1756 FIX: agent_ibmsvc: do not abort execution if one of the sections fail
* 1778 FIX: cisco_secure: do not warn for port where port security cannot be enabled
* 1764 FIX: mk_sap: Fixed exception when saving status file
+ * 1663 FIX: winperf_if: fixed incorrect enumeration of interface index...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/winperf_if b/checks/winperf_if
index 33d7117..eb67c56 100644
--- a/checks/winperf_if
+++ b/checks/winperf_if
@@ -151,10 +151,10 @@ def convert_winperf_if(info):
converted = []
# Sort NIC names are create artifical index
- nic_names = nics.keys()
+ nic_index = dict(map(lambda x: (x[1], x[0] + 1), enumerate(nic_names)))
nic_names.sort(reverse=True)
- for nr, nic_name in enumerate(nic_names):
+ for nic_name in nic_names:
nic = nics[nic_name]
mac_txt = nic.get('MACAddress')
bandwidth = saveint(nic.get('Speed'))
@@ -163,7 +163,7 @@ def convert_winperf_if(info):
else:
mac = ''
converted.append((
- str(nr + 1),
+ str(nic_index[nic_name]),
nic_name,
"loopback" in nic_name.lower() and '24' or '6',
bandwidth or nic[10], # Aktuelle Bandbreite