无为清净楼资源网 Design By www.qnjia.com

复制代码 代码如下:
#!/bin/ksh
INTERVAL=5
PREFIX=$INTERVAL-sec-status
touch /tmp/running
RUNFILE=/tmp/running
my -e 'show global variables' mysql-variables
while test -e $RUNFILE; do
file=$(date +%F_%I)
sleep=$(date +%s.%N | awk "{print $INTERVAL - (\$1 % $INTERVAL)}")
sleep $sleep
ts="$(date +"TS %s.%N %F %T")"
loadavg="$(uptime)"
echo "$ts $loadavg" $PREFIX-${file}-status
my -e 'show global status' $PREFIX-${file}-status &
echo "$ts $loadavg" $PREFIX-${file}-innodbstatus
my -e 'show engine innodb status\G' $PREFIX-${file}-innodbstatus &
echo "$ts $loadavg" $PREFIX-${file}-processlist
my -e 'show full processlist\G' $PREFIX-${file}-processlist &
echo $ts
done
echo Exiting because $RUNFILE does not exist.

标签:
MySQL,系统性能,系统状态

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com