`/proc/loadavg` give me three indicators of how much work
the system has done during the last 1, 5 & 15 minutes.
How can i get a list of load averages
that each averaged over the last minute for 10 minutes?
`/proc/loadavg` give me three indicators of how much work
the system has done during the last 1, 5 & 15 minutes.
How can i get a list of load averages
that each averaged over the last minute for 10 minutes?
#!/bin/bash
for i in 1 2 3 4 5 6 7 8 9 10
do
cat /proc/loadavg
sleep 60
done > /tmp/t.lis
awk '{ sum +=$1; print $1 } END {print sum/NF}' /tmp/t.lis > avg.lis
# use the avg variable
If you want the load averages from now onwards, you can try:
pandu$ sar -u <time-diff between samples in seconds> <no. of averages>
ex.
$ sar -u 4 2
SunOS egluit01 5.10 Generic_144488-14 sun4v 03/12/2012
12:44:17 %usr %sys %wio %idle
12:44:22 0 0 0 100
12:44:26 0 0 0 100
Average 0 0 0 100