Rename cpumon_lite to cpumon_light
[debian6500.git] / master / root / bin / cpumon_light
CommitLineData
4aba78da
LM
1#!/bin/sh
2
3INSTALL_DIR=$(dirname $0)
4
5$INSTALL_DIR/monitor_proc -s /proc/stat
6while true; do
7 sleep 1
8 $INSTALL_DIR/monitor_proc /proc/stat | \
9 awk '
10BEGIN { printf "cpu:" }
11/cpu[0-9]/ {
12 idle=$5
13 sum=0; for (i=2;i<=NF;i++) sum+=$(i)
14 load=(sum-idle)*100/sum
15 tot+=load
2796bdcb 16 if (!not_first) not_first=1; else printf " +"
4aba78da
LM
17 printf " % 5.1f%%", load
18}
19END { printf " = % 6.1f%%\n", tot }'
20done