Wrote this quickie script to give me the % CPU idle over a 10 second period.

count=0
average=0
vmstat 1 11 | tail -10 | awk '{print $16}' | while read value
do
(( count = count + value ))
done
(( average = count / 10 ))
echo "Average idle CPU is ${average}%"

About troyski

I'm a freelance UNIX engineer working in the UK. I'm married to Tina and between us we have six children. I'm a bit of an Apple fan boy, and all the Windows machines in the house are a thing of the past now.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post navigation