金沙澳门官网下载app-金沙澳门官网网址

MySQL获取系统性能和状态代码

复制代码 代码如下: #!/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 statusG' $PREFIX-${file}-innodbstatus & echo "$ts $loadavg" $PREFIX-${file}-processlist my -e 'show full processlistG' $PREFIX-${file}-processlist & echo $ts done echo Exiting because $RUNFILE does not exist.

mysql数据收集shell脚本

金沙澳门官网网址, 

#!/bin/sh 

INTERVAL=5 

PREFIX=$INTERVAL-sec-status 

金沙澳门官网下载app,RUNFILE=/home/benchmarks/running 

mysql -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")" 

本文由金沙澳门官网下载app发布于金沙澳门官网,转载请注明出处:MySQL获取系统性能和状态代码

您可能还会对下面的文章感兴趣: