ok I believe enough has been said about the idle time and using various tools. Being a Linux preson we should not be tempted to go for tools rather put your hands on some shell scripting
Here is the Linux matra for CPUs
command:- cat /proc/stat| grep cpu
output:-
#cpu (user system nice idle)---->processes
cpu 1347655 198648 156415 131616078
cpu0 408592 50247 49112 32821748
cpu1 291843 51332 33225 32953299
cpu2 336032 49001 39752 32904914
cpu3 311188 48068 34326 32936117
here the values are in jiffers (unsigned long int). The sum total and the max. value for a CPU is 33329699
that means
cpu0 408592 + 50247 + 49112 + 32821748 = 33329699
hence idle % for CPU 0 ==> (32821748/33329699)*100
cheers
dont go for readymade solutions when you can work with your own
Let me know if anyone has any questions about it.
-Rahul.