#!/bin/sh # # Recipe for creating the mysql archive # . $PCP_DIR/etc/pcp.env here=`pwd` tmp=/tmp/$$ rm -rf $tmp if pmprobe mysql 2>&1 | grep -q 'Unknown metric name' then echo "Arrg, mysql PMDA is apparently not installed" exit 1 fi version=0 while [ -f mysql-$version.0 ] do version=`expr $version + 1` done trap "rm -rf $tmp; exit" 0 1 2 3 15 echo 'log mandatory on 5sec { mysql }' >$tmp.config ${PCP_BINADM_DIR}/pmlogger -s 5 -c $tmp.config mysql-$version & # Now do some work to make mysql stats move a little # We assume the example classicmodels DB has been installed # (available from http://www.mysqltutorial.org/mysql-sample-database.aspx) # and is available to be used. # # May need to change the user and password ... SQLUSER=root SQLPASSWORD=letmein for i in 1 2 3 4 5 6 do sleep 4 cat <