# !/bin/bash
# This is version .02 of the watts up script. I have added fuctions to this script for easier use when you would like to use a diff device to gather the power consumption infomation i.e an APC.
# cpu core calculation
CPU=`/bin/cat /proc/cpuinfo | /bin/grep proc | /bin/awk '{ print $3 }' | /usr/bin/tail -n 1`
CPU=$(($CPU + 1))
# Start logging
log_start () {
# cat /dev/ttyS0 |
# ./timestamp.pl >> log/time-outputs.log &
cat /dev/ttyS0 >> log/outputs.log &
}
# Stop Logging
log_stop () {
for i in `ps aux |
grep [t]tyS0 |
awk '{ print $2 }'` ; do
kill $i
done
}
# log manipulation
log_man () {
sed log/outputs.log -e 's/,/ /g' > log/gnuplot-outputs.txt
sed -i log/gnuplot-outputs.txt -e 's/#d//g'
}
# idle
idle () {
sleep 10m
}
# Start Dhrystone
dhry_start () {
for ((i=1; i <= CPU ; i++))
do
sh dodhry.sh 2>&1 > /dev/null &
done
}
# Stop Dhrystone
dhry_stop () {
for i in `ps aux |
grep [d]hry |
awk '{ print $2 }'`; do
kill $i 2>&1 > /dev/null
done
}
# Start Linpack
lin_start () {
for ((i=1; i <= CPU ; i++))
do
sh dolinpack.sh 2>&1 > /dev/null &
done
}
# Stop LinPack
lin_stop () {
for i in `ps aux |
grep [d]o |
awk '{ print $2 }'`; do
kill $i 2>&1 > /dev/null
done
for i in `ps aux |
grep [l]pc |
awk '{ print $2 }'`; do
kill $i 2>&1 > /dev/null
done
}
# Start burn k7/p6
cpuburn () {
if cat /proc/cpuinfo | grep vendor_id | grep AuthenticAMD 2>&1 > /dev/null; then
for ((i=1; i <= CPU ; i++))
do
cpuburn-1.4/burnK7 &
done
else
for ((i=1; i <= CPU ; i++))
do
cpuburn-1.4/burnP6 &
done
fi
}
# Gnuplot
gnuplot () {
}