Linux Server Status Script
Page 1 of 1
Linux Server Status Script
- Code:
#!/bin/bash
date;
echo "uptime:"
uptime
echo "Currently connected:"
w
echo "--------------------"
echo "Last logins:"
last -a |head -3
echo "--------------------"
echo "Disk and memory usage:"
df -h | xargs | awk '{print "Free/total disk: " $11 " / " $9}'
free -m | xargs | awk '{print "Free/total memory: " $17 " / " $8 " MB"}'
echo "--------------------"
start_log=`head -1 /var/log/messages |cut -c 1-12`
oom=`grep -ci kill /var/log/messages`
echo -n "OOM errors since $start_log :" $oom
echo ""
echo "--------------------"
echo "Utilization and most expensive processes:"
top -b |head -3
echo
top -b |head -10 |tail -4
echo "--------------------"
echo "Open TCP ports:"
nmap -p- -T4 127.0.0.1
echo "--------------------"
echo "Current connections:"
ss -s
echo "--------------------"
echo "processes:"
ps auxf --width=200
echo "--------------------"
echo "vmstat:"
vmstat 1 5
#chmod 755 Server-Health.sh
#./Server-Health.sh
Similar topics
» Clam AV For Linux Run Script
» Linux Web Server Web Dev Vote Polls PHP Script
» Create A Subdomain Linux Apache2 Web Server Script
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» how to solve body onload issue on a local apache2 server with a script tag
» Linux Web Server Web Dev Vote Polls PHP Script
» Create A Subdomain Linux Apache2 Web Server Script
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» how to solve body onload issue on a local apache2 server with a script tag
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|