Module: check_mk
Branch: master
Commit: ec0689e94b16b360ec478ad201c6c97b9055d948
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ec0689e94b16b3…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Jan 2 15:30:05 2017 +0100
4182 FIX mysql_slave: fixed crash if agent output is empty
The check will not crash anymore if the agent output does not contain data
for this check. The given state will still be UNKNOWN but with more
comprehensible information like "Item not found in agent output".
Change-Id: If1b60333a3ed1870ec3b2e058a02e37d9d3076ec
---
.werks/4182 | 12 ++++++++++++
ChangeLog | 1 +
checks/mysql_slave | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/4182 b/.werks/4182
new file mode 100644
index 0000000..ffd09af
--- /dev/null
+++ b/.werks/4182
@@ -0,0 +1,12 @@
+Title: mysql_slave: fixed crash if agent output is empty
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1483367371
+Class: fix
+
+The check will not crash anymore if the agent output does not contain data
+for this check. The given state will still be UNKNOWN but with more
+comprehensible information like "Item not found in agent output".
+
diff --git a/ChangeLog b/ChangeLog
index 7890527..cd4eeb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,7 @@
* 4121 FIX: mk_mysql: fixed handling of multiple instances
* 4122 FIX: ibm_svc_enclosure: added support for firmware >= 7.8...
* 4176 FIX: postfix_mailq_status: fixed wrong status handling
+ * 4182 FIX: mysql_slave: fixed crash if agent output is empty...
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/mysql_slave b/checks/mysql_slave
index 6d89d6e..ee22f60 100644
--- a/checks/mysql_slave
+++ b/checks/mysql_slave
@@ -76,7 +76,7 @@ def inventory_mysql_slave(parsed):
def check_mysql_slave(item, params, parsed):
- if item in parsed:
+ if parsed.get(item):
data = parsed[item]
state = 0