Topic: Statistics on SSH Login: Server Info
Upon logging into my server I like see an overview of some very basic system statistics including:
Hard drive temperatures
Disk space
Memory Usage
Uptime and load
I've been using the ugly script below and calling it from my ~/.bashrc so it gets loaded automatically upon login. Anyone else do something similar or have recommended improvements?
As of now the output looks something like this:
Disks temps:
/
194 Temperature_Celsius 0x001a 040 054 000 Old_age Always - 40 (0 18 0 0)
/redundant
194 Temperature_Celsius 0x0022 110 094 000 Old_age Always - 40
Disk space:
/dev/sda1 109G 7.6G 96G 8% /
/dev/sdb1 1.8T 473G 1.4T 27% /redundant
/dev/sdc1 459G 88G 348G 21% /backups
Memory:
total used free shared buffers cached
Mem: 881 482 399 0 72 251
-/+ buffers/cache: 158 723
Swap: 1722 240 1482
Uptime and load:
14:28:24 up 21:03, 3 users, load average: 1.95, 2.10, 2.11And here's the script that produces it:
echo "Disks temps:"
echo "/"
sudo smartctl -a /dev/sda | grep "Temperature_Celsius"
echo "/redundant"
sudo smartctl -a -d usbjmicron,1 /dev/sdb | grep "Temperature_Celsius"
echo ""
echo "Disk space:"
df -h | grep /dev/sd
echo ""
echo "Memory:"
free -m
echo ""
echo "Uptime and load:"
uptime