Monday, 8 August 2016

Bash script to monitor uptime, cpu, memory, swap memory, load average of linux system


# Print system resources
echo "HOSTNAME: "`hostname`
echo "SYSTEM: "`uname -a`
echo "IP ADDRESS: "; ifconfig eth0
echo "ROUTE TABLE:"; route -n
echo ""

# Start monitoring the system resources
while true
    echo ------ `date` ------
    top -b n1 | head -n 6
    sleep 60

No comments:

Post a Comment