Created
May 28, 2012 12:05
-
-
Save ojimac/2818803 to your computer and use it in GitHub Desktop.
mysqlの接続数を取得するスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
d=`date +'%Y-%m-%d %H:%M'` | |
result=`mysqladmin -uroot -pjup1ter extended-status | grep 'Threads_connected' | awk -F"|" '{print $3}'` | |
echo $d : $result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
日付、時間も入れて
日時 : 接続数
の形式で出力するようにした。
fileに吐き出す場合は、5行目を、
echo $d : $result >> result.txt
のように変更する