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: