Skip to content

Instantly share code, notes, and snippets.

@johanburati
Created January 31, 2020 06:57
Show Gist options
  • Save johanburati/0252758244d6e038119177866b57b312 to your computer and use it in GitHub Desktop.
Save johanburati/0252758244d6e038119177866b57b312 to your computer and use it in GitHub Desktop.
Script to monitor system
#!/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