Created
January 31, 2020 06:57
-
-
Save johanburati/0252758244d6e038119177866b57b312 to your computer and use it in GitHub Desktop.
Script to monitor system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
echo "============[START]============" | |
echo | |
echo "CURRENT TIME AND SYSTEM INFO" | |
date | |
uname -a | |
echo | |
echo "LARGEST CPU USERS" | |
echo "# ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10 :" | |
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10 | |
echo | |
echo "LARGEST MEM USERS" | |
echo "# ps aux --sort -rss | head -10 :" | |
ps aux --sort -rss | head -10 | |
echo | |
echo "FREE MEMORY" | |
echo "# free -mh" | |
free -mh | |
echo | |
echo "CURRENT NETWORK CONNECTIONS" | |
echo "# netstat -atunp:" | |
netstat -atunp | |
echo | |
echo "CURRENT IP SETTINGS" | |
echo "# ip addr:" | |
ip addr | |
echo | |
echo "CURRENT IP ROUTES" | |
echo "# ip route:" | |
ip route | |
echo | |
echo "LAST DMESG INFORMATION" | |
echo "# dmesg | tail -n 200:" | |
dmesg | tail -n 200 | |
echo | |
echo "DISK SPACE" | |
echo "# df -h" | |
df -h | |
echo | |
echo "============[END]============" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment