I have stored all servers hostname in … Probably one of the most used commands on Linux would be top. List Processes based on %CPU and Memory Usage. Now execute shell script. We added many useful shell scripts in the past. Check Top Processes sorted by RAM or CPU Usage in Linux The following command will show the list of top processes ordered by RAM and CPU use in descendant form (remove the pipeline and head if you want to see the full list): # ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head CPU – These are percentages of total CPU time. copy above script and paste in CpuAlert.sh file then provide the exective permissions using below command. The ps command command displays every process (-e) with a user-defined format (-o pcpu). Enable SNMP readonly community # ps -eocomm,pcpu | egrep -v ' (0.0)| (%CPU)' kworker/0:1H 0.3 stress 99.9 stress 46.7 stress 99.9 kworker/u8:2 0.3 kworker/u8:1 0.3. 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. Updated May 11, 2020 SAR stands for System Activity Report, as its name suggest sar command is used to collect,report & save CPU, Memory, I/O usage in Unix like operating system. The top command can be used to display system summary information and current utilization. A lightweight open-source utility to monitor the Linux server.