Skip to content

Instantly share code, notes, and snippets.

@usure
Created October 28, 2011 00:42
Show Gist options
  • Save usure/1321319 to your computer and use it in GitHub Desktop.
Save usure/1321319 to your computer and use it in GitHub Desktop.
SystemMonitor BASH
#!/bin/bash
############# SYSTEM MONITOR ######################
#Made by Gregory12z
#UNFINISHED. Only shows minimal info. ALSO... Next version will use ncurses.
#Enjoy.
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
while :
do
tput clear
echo -e "\033[38;5;148m############# SYSTEM MONITOR #############\033[39m"
ifconfig eth0|grep "inet addr:"|awk '{print $2}'|awk -F : '{print $2}'
date
hostname
ps aux|awk 'NR > 0 { s +=$3 }; END {print "cpu %",s}'
echo
echo
echo -e "\e[31mVirtual Memory Stats\033[0m"
vmstat
echo
echo
echo -e "\e[34mDISK SPACE\033[0m"
df --si
echo
echo
echo -e "\033[38;5;148m############# SYSTEM MONITOR #############\033[39m"
sleep 3
done
#exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment