Module: check_mk
Branch: master
Commit: 3254092ff6feefbd511c50c87d0dd3f0b6613651
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3254092ff6feef…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Aug 17 15:06:26 2017 +0200
5112 FIX if.include: Fixed wrong handling of duplicate interfaces if 'use alias'
or 'use desccription' is configured
Change-Id: I5c713ba0ec0eec9e87c15f771e52ddd0ad2e09d0
---
.werks/5112 | 19 +++++++++++++++++++
checks/if.include | 2 +-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/.werks/5112 b/.werks/5112
new file mode 100644
index 0000000..4c20abf
--- /dev/null
+++ b/.werks/5112
@@ -0,0 +1,19 @@
+Title: if.include: Fixed wrong handling of duplicate interfaces if "use alias"
or "use desccription" is configured
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1502973584
+
+Within the rule {{Network Interface and Switch Port Discovery}}
+you are able to configure the service description to use the
+interface alias or description. Per default the index is used.
+If there are duplicate interfaces with same name, the interface
+index should be added.
+
+
+Unfortunately, the afore-mentioned mechanism was broken. This
+has been fixed.
diff --git a/checks/if.include b/checks/if.include
index 3d0a3ed..321013e 100644
--- a/checks/if.include
+++ b/checks/if.include
@@ -417,7 +417,7 @@ def inventory_if_common(info, has_nodeinfo = False):
# Prepare single interfaces
if not is_only_in_group:
- if ifIndex in global_seen:
+ if item in global_seen:
continue
if item in seen_items: # duplicate