Module: check_mk
Branch: master
Commit: a4ab176b8a634366587e678a5d7c1053c4fec809
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a4ab176b8a6343…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed May 24 12:04:09 2017 +0200
4740 FIX mysql: Fixed crash if instance is not available anymore
Change-Id: I43223fcee6b27baeb8f47e57d18afb8e2652518f
---
.werks/4740 | 10 ++++++++++
checks/mysql | 4 ++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/.werks/4740 b/.werks/4740
new file mode 100644
index 0000000..3764660
--- /dev/null
+++ b/.werks/4740
@@ -0,0 +1,10 @@
+Title: mysql: Fixed crash if instance is not available anymore
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1495620206
+Class: fix
+
+
diff --git a/checks/mysql b/checks/mysql
index 5f51084..3fcd135 100644
--- a/checks/mysql
+++ b/checks/mysql
@@ -94,7 +94,7 @@ def inventory_mysql_version(parsed):
yield instance, {}
def check_mysql_version(item, _no_params, parsed):
- if item in parsed:
+ if item in parsed and not len(parsed[item]) == 0:
values = parsed[item]
return 0, "Version: " + values['version']
@@ -125,7 +125,7 @@ check_info['mysql'] = {
def check_mysql_sessions(item, params, parsed):
- if item in parsed:
+ if item in parsed and not len(parsed[item]) == 0:
values = parsed[item]
total_sessions = values["Threads_connected"]
running_sessions = values["Threads_running"]