I am trying to build a CPU Usage shell script and need a shell command that will give me the result of the usage percentage of lets say CPU 0. Seems sysctl kern.cp_time may be the way to go, but not sure of the results that generates.
Maybe a better command, not sure. I am not a guru by any stretch.
Ultimate purpose of this script is to alert me via email if the cpu usage hits 100%. Got every part of the script working except for the CPU Usage calculation.
Any help is greatly appreciated.
Thanks
Dan
Maybe a better command, not sure. I am not a guru by any stretch.
Ultimate purpose of this script is to alert me via email if the cpu usage hits 100%. Got every part of the script working except for the CPU Usage calculation.
Any help is greatly appreciated.
Thanks
Dan