Module: check_mk
Branch: master
Commit: 779c67dd1eeea6f129659f072532bab066d28c92
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=779c67dd1eeea6…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Mar 15 11:15:49 2016 +0100
3099 FIX mk_mysql: worked around problems where running instances can't be discovered
---
.werks/3099 | 10 ++++++++++
ChangeLog | 1 +
agents/plugins/mk_mysql | 6 +++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/3099 b/.werks/3099
new file mode 100644
index 0000000..581c269
--- /dev/null
+++ b/.werks/3099
@@ -0,0 +1,10 @@
+Title: mk_mysql: worked around problems where running instances can't be discovered
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1458036668
+
+
diff --git a/ChangeLog b/ChangeLog
index 1d19bbb..998860d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -79,6 +79,7 @@
* 3261 FIX: cisco_temperature: fixed wrong datatype handling
* 3007 FIX: Interface groups: fixed exception when port type or interface items were
not set in the WATO rule...
* 3098 FIX: isc_dhcpd: fixed handling of leases that never expire
+ * 3099 FIX: mk_mysql: worked around problems where running instances can't be
discovered
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/agents/plugins/mk_mysql b/agents/plugins/mk_mysql
index cb8812e..d278d12 100755
--- a/agents/plugins/mk_mysql
+++ b/agents/plugins/mk_mysql
@@ -66,7 +66,11 @@ then
mysql_sockets="--"$(fgrep socket $MK_CONFDIR/mysql.cfg)
if [ $mysql_sockets = "--" ] ; then
mysql_sockets=$(ps -ef | grep mysqld | grep "[s]ocket" | sed -ne
's/.*socket=\([^ ]*\).*/\1/p')
- for socket in $mysql_sockets ; do do_query "--socket="$socket ; done
+ if [ -z $mysql_sockets ] ; then
+ do_query ""
+ else
+ for socket in $mysql_sockets ; do do_query "--socket="$socket ; done
+ fi
else
do_query ""
fi