![]() Set an executable Linux file permission to “cpu-memory-swap-2.sh” file. 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` This script allows you to check CPU, memory and swap usage on multiple Linux system from the terminal. 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. just start with running top with no arguments. Let us see all commands to check memory usage on Debian Linux cloud or bare metal server. you can also run top -u USER to only see a specific users processes. user2561747 at 3:03 1 psrecord worked well, thank you. Note for the psrecord method, Ctrl+C on the psrecord process just quits without saving a plot, you need to end the process-under-test. You can use this script to generate a CPU, memory and swap usage for a multiple Linux system. 1 Are you familiar with top Shows you CPU and RAM usage (and more) for each process and also the total sum. This should be the accepted answer, since it actually gives a memory usage history plot. 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |