Module: check_mk
Branch: master
Commit: 8cd8929735b01a6531e96b8bc2a41646a9887c85
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8cd8929735b01a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Mar 9 12:09:51 2018 +0100
5774 FIX if.include: Wrong items were discovered which led to vanished/undecided(unknown)
services
Change-Id: I87e979697a52c937d462c470239d5306044d000e
---
.werks/5774 | 10 ++++++++++
checks/if.include | 9 +++------
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/.werks/5774 b/.werks/5774
new file mode 100644
index 0000000..92027d1
--- /dev/null
+++ b/.werks/5774
@@ -0,0 +1,10 @@
+Title: if.include: Wrong items were discovered which led to vanished/undecided(unknown)
services
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i4
+Date: 1520593714
+Class: fix
+
+
diff --git a/checks/if.include b/checks/if.include
index 42312af..a50fc7f 100644
--- a/checks/if.include
+++ b/checks/if.include
@@ -288,7 +288,7 @@ def inventory_if_common(info, has_nodeinfo = False):
return []
settings_sets = host_extra_conf(host_name(), inventory_if_rules)
- global_seen = set()
+ seen_indicies = set()
pre_inventory = []
if not settings_sets:
@@ -318,7 +318,6 @@ def inventory_if_common(info, has_nodeinfo = False):
# Allow main check to set no port type (e.g. hitachi_hnas_fc_if)
porttypes.append("")
pre_inventory_groups = []
- local_seen = set()
have_groups = {}
# Determine whether single, grouped or both
@@ -412,7 +411,7 @@ def inventory_if_common(info, has_nodeinfo = False):
is_only_in_group = True
# Prepare single interfaces
- if not is_only_in_group and ifIndex not in global_seen and \
+ if not is_only_in_group and ifIndex not in seen_indicies and \
ifType in porttypes and ifOperStatus in portstates and \
port_match(ifAlias, match_alias) and port_match(ifDescr, match_desc):
params = {}
@@ -421,11 +420,9 @@ def inventory_if_common(info, has_nodeinfo = False):
if ifSpeed != "" and if_inventory_monitor_speed:
params["speed"] = int(ifSpeed)
- local_seen.add(ifIndex)
+ seen_indicies.add(ifIndex)
pre_inventory.append((item, "%r" % params, int(ifIndex)))
- global_seen = global_seen.union(local_seen)
-
# Create pseudo interfaces out of groups
# On cluster groups we have no 'interfaces' key
for group_name, attrs in have_groups.items():