Last active
August 29, 2015 14:05
-
-
Save sahal/c225dbf6515f636e484c to your computer and use it in GitHub Desktop.
Generate very simple server stats using this bash script. Who needs phpSysInfo?
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 | |
# ./gen-server-stats.sh | |
# by Sahal Ansari - github.com/sahal | |
# desc: generates a list of stats on the box you're on. Not as impressive as phpSysInfo. | |
# | |
# run it every hour via cron, if you'd like: | |
# 0 * * * * /home/user/gen-server-stats.sh > /home/user/public_html/stats | |
# generate "html": | |
#echo "<pre>" | |
function stats { | |
echo \$ "$1" | |
eval "$1" | |
echo | |
} | |
echo "System Vital: " | |
stats date | |
#stats hostname | |
stats "uname -a" | |
stats uptime | |
echo "Hardware Information: " | |
stats lscpu | |
#stats "cat /proc/cpuinfo" | |
stats lspci | |
stats lsusb | |
echo "Memory Usage: " | |
stats "free -m" | |
echo "Mounted Filesystems: " | |
stats "df -h --total" | |
echo "Network Usage: " | |
stats "ip a" | |
#stats ifconfig # this will not work if running as a non-root user on Debian | |
#stats "vnstat -s" # you'll need to install: http://humdi.net/vnstat/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment