Module: check_mk
Branch: master
Commit: 1e54c102f085505b1e6013ee19b9b94475eaf25f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1e54c102f08550…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 17 15:42:49 2015 +0200
#2609 FIX mysql_capacity: Can now handle sizes reported being NULL
The discovery is now skipping all databases reported with a size
or capacity of 'NULL'. The check function can also deal with this
situation to prevent crash reports. Users experiencing this situation
should update and rediscover the services of the affected hosts to
remove the useless database checks.
---
.werks/2609 | 13 +++++++++++++
ChangeLog | 1 +
checks/mysql_capacity | 5 ++++-
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.werks/2609 b/.werks/2609
new file mode 100644
index 0000000..65abfb1
--- /dev/null
+++ b/.werks/2609
@@ -0,0 +1,13 @@
+Title: mysql_capacity: Can now handle sizes reported being NULL
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1442497282
+Class: fix
+
+The discovery is now skipping all databases reported with a size
+or capacity of 'NULL'. The check function can also deal with this
+situation to prevent crash reports. Users experiencing this situation
+should update and rediscover the services of the affected hosts to
+remove the useless database checks.
diff --git a/ChangeLog b/ChangeLog
index a9c49d3..e15c45b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -191,6 +191,7 @@
* 2606 FIX: cisco_temperature: Reduced SNMP overhead for large devices...
* 2428 FIX: "Clustered services for overlapping cluster": Improved rule matching...
* 2608 FIX: kemp_loadmaster_ha: Fixed wrong discovery on snmp monitored linux systems
+ * 2609 FIX: mysql_capacity: Can now handle sizes reported being NULL...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce unhandled exceptions...
diff --git a/checks/mysql_capacity b/checks/mysql_capacity
index 3f42989..760a885 100644
--- a/checks/mysql_capacity
+++ b/checks/mysql_capacity
@@ -64,7 +64,8 @@ def parse_mysql_capacity(info):
def inventory_mysql_size(parsed):
for instance, values in parsed.items():
for dbname, used, avail in values:
- if dbname not in [ "information_schema", "mysql", "performance_schema" ]:
+ if dbname not in [ "information_schema", "mysql", "performance_schema" ] \
+ and used != 'NULL' and avail != 'NULL':
yield "%s:%s" % (instance, dbname), None
@@ -75,6 +76,8 @@ def check_mysql_size(item, params, parsed):
# size and avail are given as bytes
for db, size, avail in dbs:
if db == dbname:
+ if size == 'NULL':
+ return 3, "Missing information - Size is reported as 'NULL'"
size = int(size)
infotext = "Size is %s" % get_bytes_human_readable(size)
if params:
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():