Advertisement
fduran

Linux Server Utilization

Apr 18th, 2011
788
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.91 KB | None | 0 0
  1. #!/bin/bash
  2. # www.fduran.com
  3. date;
  4. echo "uptime:"
  5. uptime
  6. echo "Currently connected:"
  7. w
  8. echo "--------------------"
  9. echo "Last logins:"
  10. last -a |head -3
  11. echo "--------------------"
  12. echo "Disk and memory usage:"
  13. df -h | xargs | awk '{print "Free/total disk: " $11 " / " $9}'
  14. free -m | xargs | awk '{print "Free/total memory: " $17 " / " $8 " MB"}'
  15. echo "--------------------"
  16. start_log=`head -1 /var/log/messages |cut -c 1-12`
  17. oom=`grep -ci kill /var/log/messages`
  18. echo -n "OOM errors since $start_log :" $oom
  19. echo ""
  20. echo "--------------------"
  21. echo "Utilization and most expensive processes:"
  22. top -b |head -3
  23. echo
  24. top -b |head -10 |tail -4
  25. echo "--------------------"
  26. echo "Open TCP ports:"
  27. nmap -p- -T4 127.0.0.1
  28. echo "--------------------"
  29. echo "Current connections:"
  30. ss -s
  31. echo "--------------------"
  32. echo "processes:"
  33. ps auxf --width=200
  34. echo "--------------------"
  35. echo "vmstat:"
  36. vmstat 1 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement