Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

MySQL Monitoring 101 System Monitoring MySQL Monitoring 101

26,653 views

Published on

MySQL Monitoring 101


System Monitoring

❖ dstat
$ cat dbc_os.sh

#!/bin/sh

DATETIME=`date +%y%m%d.%H%M`

LOG_DIR=quot;/opt/monitor/log/quot;
INTERVAL=5
COUNT=`expr 3600 / $INTERVAL`
LOG_FILE=${LOG_DIR}os.${DATETIME}.${INTERVAL}.txt
CSV_LOG_FILE=${LOG_DIR}os.${DATETIME}.${INTERVAL}.csv
MYSQL_LOG_FILE=${LOG_DIR}os.${DATETIME}.${INTERVAL}.mysql.csv

/usr/bin/dstat --time --cpu --mem --disk --net --proc --page --swap --load --nocolor --noheaders --output $
{CSV_LOG_FILE} $INTERVAL $COUNT > $LOG_FILE 2>&1
sed -e quot;1,7dquot; -e quot;s/-/,/quot; -e quot;s/ /,/quot; ${CSV_LOG_FILE} > ${MYSQL_LOG_FILE}
exit 0

http://ronaldbradford.com

Published in: Technology, Design

×