Powershell script to monitor CPU utilization and notify on a threshold breach Here is a simple powershell script which will take a list of servers as input, monitors CPU load and sends email notifications incase of threshold breach (which is set in script). Updated August 19, 2017. More ways to check CPU utilization There are a few more tools we can use to check CPU usage, and they’re contained in the sysstat package. Ubuntu and Debian: $ sudo apt-get install sysstat CentOS and Red Hat: # yum install sysstat Linux : Get average CPU and Memory utilization from SAR data Published by azwan.ngali on July 9, 2014. We can simply sort the current executing processes with its CPU and Memory conception ratio. The ps command command displays every process (-e) with a user-defined format (-o pcpu). It will trigger an email when your system reaches 80% CPU utilization. Available Free Memory is 0.99 GB Linux 2.6.18-274.el5 (XXXXXXXXX) 10/15/15 00:00:02 kbmemfree kbmemused %memused kbbuffers kbcached kbswpfree kbswpused %swpused kbswpcad 00:10:01 4630292 11674812 71.60 342120 8428736 4096440 124 0.00 0 00:20:01 4632356 11672748 71.59 342120 8429228 4096440 124 0.00 0 00:30:01 4595960 11709144 71.81 342128 8429712 4096440 … The 5 indicates that it should display every 5 seconds. Last Updated: September 9, 2019. Finally add a cronjob to automate this. copy above script and paste in CpuAlert.sh file then provide the exective permissions using below command. (system time) id: Time spent idle. SAR command produce the reports on the fly and can also save the reports in the log files as well. How to automate day to day activities using shell scripts?