Module: check_mk
Branch: master
Commit: 9eaff28ab82638688c6ed73b54e506e06614314f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9eaff28ab82638…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Fri Apr 12 08:41:19 2019 +0200
mk_mysql: remove redundant code
Change-Id: I55c1916dc9f026f7b94e86dd6a2306cb312091bb
---
agents/plugins/mk_mysql | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/agents/plugins/mk_mysql b/agents/plugins/mk_mysql
index be2254e..117fc6c 100755
--- a/agents/plugins/mk_mysql
+++ b/agents/plugins/mk_mysql
@@ -25,14 +25,14 @@
# gets optional socket as argument
function do_query() {
- INSTANCE=$(echo $1|awk -v FS="=" '{print $2}')
+ SOCKET="$1"
COUNT=$(ps -fww -C mysqld | grep socket | wc -l)
if [ $COUNT -gt 1 ]
then
- INSTANCE_NAME=$(ps -efww|grep socket|grep "${INSTANCE}"|grep
"[u]ser" | sed -ne 's/.*socket=\([^.]*\).*/\1/p')
+ INSTANCE_NAME=$(ps -efww|grep socket|grep "${SOCKET}"|grep
"[u]ser" | sed -ne 's/.*socket=\([^.]*\).*/\1/p')
INSTANCE_NAME="[[${INSTANCE_NAME##*/}]]"
else
- INSTANCE_NAME="[[$(ps -efww|grep socket|grep "${INSTANCE}"|grep
"[u]ser" | sed -ne 's/.*user=\([^ ]*\).*/\1/p')]]"
+ INSTANCE_NAME="[[$(ps -efww|grep socket|grep "${SOCKET}"|grep
"[u]ser" | sed -ne 's/.*user=\([^ ]*\).*/\1/p')]]"
fi
@@ -74,7 +74,7 @@ then
do_query ""
else
for socket in $mysql_sockets ; do
- do_query "--socket="$socket
+ do_query "$socket"
done
fi
#echo "<<<mysql_version>>>"