Skip to content

Instantly share code, notes, and snippets.

@c1b3rh4ck
Created January 24, 2015 20:58
Show Gist options
  • Save c1b3rh4ck/186ce227997a5b79a203 to your computer and use it in GitHub Desktop.
Save c1b3rh4ck/186ce227997a5b79a203 to your computer and use it in GitHub Desktop.
statistics
#!/bin/bash
#Show some statistics of the server.
#Colors
red='\e[0;31m'
RED='\e[1;31m'
blue='\e[0;34m'
BLUE='\e[1;34m'
cyan='\e[0;36m'
CYAN='\e[1;36m'
NC='\e[0m'
echo -e "${red}
Information System Stats
${w}@c1b3rh4ck${fin}"
echo
date;
echo -e "${r}Currently Users Connected:${fin}"
w;
echo -e "____________________________"
echo -e "${r}Last 5 Logins:${fin}"
last -a |head -5;
echo -e "____________________________"
echo -e "${r}Current Connections:${fin}"
echo -e "${gr}"
ss | awk '{print $1 " " $4 " " $5 }';
echo -e "____________________________"
echo -e "${r}Disk Usage:${fin}"
df -h | xargs | awk '{print "Free/Total Disk:" $11 "/" $9}';
free -m | xargs |awk'{print "Free/Total mem:" $17 "/" $8 "MB"}';
echo -e "____________________________"
echo -e "${r}Process Information:${fin}"
top -b |head -10 |tail -5 ;
echo -e "____________________________"
echo -e "${r}Virtual Memory Stats "
vmstat 1 5 ;
echo -e "${fin}EOF"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment