blob: a1dbcdb378bd83ba5d2de5549496413cc96a32c1 (
plain)
1
2
3
4
5
6
7
|
#!/bin/bash
while true; do
cpu=`mpstat -P ALL 10 1 | grep "Average.*all" | awk '{print $3+$5}'`
mem=`free | grep Mem | awk '{print $3/$2 * 100.0}'`
printf "C%.*f\n" 1 $cpu
printf "R%.*f\n" 0 $mem
done
|