Module: check_mk
Branch: master
Commit: 23844cacd66901588f48abe90bee8d83e916895d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=23844cacd66901…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 13 14:41:43 2015 +0200
#2507 FIX mysql_slave: fixed exception caused by wrong parsing of agent data
---
.werks/2507 | 10 ++++++++++
ChangeLog | 1 +
checks/mysql_slave | 16 +++++++++-------
3 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/.werks/2507 b/.werks/2507
new file mode 100644
index 0000000..984247a
--- /dev/null
+++ b/.werks/2507
@@ -0,0 +1,10 @@
+Title: mysql_slave: fixed exception caused by wrong parsing of agent data
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1439469675
+
+
diff --git a/ChangeLog b/ChangeLog
index 40bb87d..d2e957e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -114,6 +114,7 @@
* 2506 FIX: Diskstat summary: Ignoring stats from LVM devices
* 2455 FIX: raritan_pdu_inlet: Fixed scaling...
* 2492 FIX: check_mk_agent.linux: avoid problems with crashing waitmax after Ubuntu
update...
+ * 2507 FIX: mysql_slave: fixed exception caused by wrong parsing of agent data
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/mysql_slave b/checks/mysql_slave
index 0b0d352..dd3b705 100644
--- a/checks/mysql_slave
+++ b/checks/mysql_slave
@@ -39,7 +39,9 @@ def parse_mysql_slave(info):
val = False
elif val == 'None':
val = None
- return val
+ return line[0][:-1], val
+ else:
+ return None, None
parsed = {}
instance = False
@@ -49,17 +51,17 @@ def parse_mysql_slave(info):
instance = line[0][2:-2]
parsed[instance] = []
elif instance:
- value = parse_line(line)
- if value:
- parsed[instance][line[0][:-1]] = value
+ key, value = parse_line(line)
+ if key:
+ parsed[instance][key] = value
# Support for old Plugin version
if not instance:
parsed['mysql'] = {}
for line in info:
- value = parse_line(line)
- if value:
- parsed['mysql'][line[0][:-1]] = value
+ key, value = parse_line(line)
+ if key:
+ parsed['mysql'][key] = value
return parsed