Advertisement
Guest User

Untitled

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