![]() ![]() Scpu=$(ssh $server cat /proc/stat | awk '/cpu/')Įcho "$server, $scpu, $smem, $sswap" > /tmp/cpu-mem-swap.csvĮcho "CPU and Memory Report for `date +"%B %Y"`" | mailx -s "CPU and Memory Report on `date`" -a /tmp/cpu-mem-swap.csv ![]() # vi /opt/scripts/cpu-memory-swap.shĮcho "-"Įcho "Server_Name CPU(%) Memory(%) Swap(%)"įor server in `more /opt/scripts/server-list.txt` Here are some comments: - this bash script could be placed on crontab to send an email when the CPU will reach 60 usage (or other value). The top-left section comprises the CPU and memory usage. CPU Usage Monitoring on Linux (using bash) In this tutorial you have an example of bash script for monitoring the CPU usage on Linux machines. This script allows you to check CPU, memory and swap usage on multiple Linux system from the terminal. A simple Shell script to Capture CPU, Memory utilization and Number of file descriptors ( using top and lsof command) over the time and output into csv for. The whole window above can be split up into three sections for the ease of our understanding. ![]() Method-1 : Shell Script to Check CPU, Memory and Swap usage on Multiple Linux System Three shell scripts are added in this tutorial to generate a report.Įach bash script has written with unique features and choose the one you need.Īlso, you can modify this script based on your needs. You can use this script to generate a CPU, memory and swap usage for a multiple Linux system. This script will help you to create a report for you. ![]() You have a small infrastructure and want to check multiple system performance simultaneously for some reason. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |