Created
August 24, 2015 14:26
-
-
Save harunyardimci/b01c98c2746618363ddb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # add this to /etc/bashrc or /etc/profile | |
| #------------------------------------------ | |
| CPUTIME=$(ps -eo pcpu | awk 'NR>1' | awk '{tot=tot+$1} END {print tot}') | |
| CPUCORES=$(cat /proc/cpuinfo | grep -c processor) | |
| UP=$(echo `uptime` | awk '{ print $3 " " $4 }') | |
| echo " | |
| System Status | |
| Updated: `date` | |
| - Server Name = `hostname` | |
| - OS Version = `cat /etc/redhat-release` | |
| - Load Averages = `cat /proc/loadavg` | |
| - System Uptime = `echo $UP` | |
| - Platform Data = `uname -orpi` | |
| - CPU Usage (average) = `echo $CPUTIME / $CPUCORES | bc`% | |
| - Memory free (real) = `free -m | head -n 2 | tail -n 1 | awk {'print $4'}` Mb | |
| - Memory free (cache) = `free -m | head -n 3 | tail -n 1 | awk {'print $3'}` Mb | |
| - Swap in use = `free -m | tail -n 1 | awk {'print $3'}` Mb | |
| - Disk Space Used = `df / | awk '{ a = $4 } END { print a }'` | |
| " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment