본문 바로가기

개발/Server Side

mysql status monitoring

10초 단위로 table status 와 innodb 관련 항목 로깅. 


cat mysql_status_check.sql

show table status\G

SHOW STATUS LIKE 'innodb%';



cat logmysqlstat.sh*
#!/bin/bash
for x in {1..6}
do
        mysql -u root -p'password' -D mydb < mysql_status_check.sql > logs/mysqlstat_`date +%F_%T`;
        sleep 10;
done


crontab -l
* * * * * /home/ubuntu/logmysqlstat.sh



'개발 > Server Side' 카테고리의 다른 글

MySQL replication에 SSL 설정  (0) 2014.04.02
vmstat 주기적 로깅  (0) 2013.05.15
UNIX Command Tips (펌)  (0) 2013.05.11
tomcat nio 설정  (0) 2013.05.07
prompt 설정  (0) 2013.05.06