Guest User

Untitled

a guest
May 28th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. # Sample output:
  2. #
  3. # Server Uptime ...................... 185.27 Days
  4. # Storage Space Used ................. 24.6% (48.87 of 149.50 GiB)
  5. # Server RAM Used .................... 27.5% (554.59 of 2013.97 MiB)
  6. # Recent CPU Load .................... 0.0% (15 Min Average: 0.0%)
  7. # Current Processes .................. 182
  8. # Total processes since boot ......... 6,386,390
  9.  
  10. # Code to add to /etc/profile or similar
  11. #
  12. awk '{ printf "Server Uptime ...................... %.2f Days\n", ($1/60/60/24) }' '/proc/uptime'
  13.  
  14. df '--portability' '--block-size=1' '/' | \
  15. awk "
  16. /^\// {
  17. printf \"Storage Space Used ................. %.1f%% (%.2f of %.2f GiB)\n\",
  18. (\$3*100/\$2),
  19. (\$3/1024/1024/1024),
  20. (\$4/1024/1024/1024)
  21. }
  22. " # End awk
  23.  
  24. { free -k | tr '\n' ' '; echo; } |\
  25. awk "
  26. {
  27. printf \"Server RAM Used .................... %.1f%% (%.2f of %.2f MiB)\n\",
  28. (\$16*100/\$8),
  29. (\$16/1024),
  30. (\$8/1024)
  31. }
  32. " # End awk
  33.  
  34. awk '
  35. {
  36. printf "Recent CPU Load .................... %.1f%% (15 Min Average: %.1f%%)\n",
  37. ($1*100/4),
  38. ($3*100/4)
  39. }' '/proc/loadavg'
  40.  
  41. sed -e 's+.*[0-9]*/+Current Processes .................. +; s+ [^ ]*$++' '/proc/loadavg'
  42.  
  43. LC_ALL='en_US.UTF-8' gawk "
  44. /processes/ {
  45. printf \"Total processes since boot ......... %'.0f\n\n\", \$2
  46. }" '/proc/stat'
Add Comment
Please, Sign In to add comment