Module: check_mk
Branch: master
Commit: 13c6b3b8425baecc8f8135f429aa2deac6598b66
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=13c6b3b8425baeā¦
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Sep 17 09:37:02 2015 +0200
#2428 FIX "Clustered services for overlapping cluster": Improved rule matching
The matching algorhytm for this rules did not check if the matched
cluster did actually belong to the node.
For example if you had the following clusters
<pre>
ClusterA: Host1, Host2
ClusterB: Host3, Host4
</pre>
And these "Clustered services for overlapping cluster" rules
<pre>
Rule 1) Service1 -> ClusterA
Rule 2) Service1 -> ClusterB
</pre>
If Host3 has a Service1, the rule number one would match and
assign this service to ClusterA, ignoring the fact that this
host is actually a part of ClusterB.
This has been fixed.
---
.werks/2428 | 27 +++++++++++++++++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 6 ++++--
3 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/.werks/2428 b/.werks/2428
new file mode 100644
index 0000000..e1b17f6
--- /dev/null
+++ b/.werks/2428
@@ -0,0 +1,27 @@
+Title: "Clustered services for overlapping cluster": Improved rule matching
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1442474788
+Class: fix
+
+The matching algorhytm for this rules did not check if the matched
+cluster did actually belong to the node.
+
+For example if you had the following clusters
+<pre>
+ClusterA: Host1, Host2
+ClusterB: Host3, Host4
+</pre>
+And these "Clustered services for overlapping cluster" rules
+<pre>
+Rule 1) Service1 -> ClusterA
+Rule 2) Service1 -> ClusterB
+</pre>
+
+If Host3 has a Service1, the rule number one would match and
+assign this service to ClusterA, ignoring the fact that this
+host is actually a part of ClusterB.
+
+This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 88182ce..4c66ef9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -189,6 +189,7 @@
* 2594 FIX: mem.linux: Remove several bogus exceeding time graphs
* 2605 FIX: mbg_lantime_ng_fan: Fixed exception in check / added missing man page
* 2606 FIX: cisco_temperature: Reduced SNMP overhead for large devices...
+ * 2428 FIX: "Clustered services for overlapping cluster": Improved rule
matching...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 1402143..bfe067d 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -931,8 +931,10 @@ def host_of_clustered_service(hostname, servicedesc):
return hostname
cluster_mapping = service_extra_conf(hostname, servicedesc,
clustered_services_mapping)
- if cluster_mapping:
- return cluster_mapping[0]
+ for cluster in cluster_mapping:
+ # Check if the host is in this cluster
+ if cluster in the_clusters:
+ return cluster
# 1. New style: explicitly assigned services
for cluster, conf in clustered_services_of.items():