Skip to content

Instantly share code, notes, and snippets.

@kolunar
Created April 24, 2017 22:58
Show Gist options
  • Save kolunar/11ce88d115b9bbf5259e2796b7032579 to your computer and use it in GitHub Desktop.
Save kolunar/11ce88d115b9bbf5259e2796b7032579 to your computer and use it in GitHub Desktop.
Monitoring Resources
Command to display Memory usage, Disk Usage and CPU Load
========================================================
free -m | awk 'NR==2{printf "Memory Usage: %s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }'
df -h | awk '$NF=="/"{printf "Disk Usage: %d/%dGB (%s)\n", $3,$2,$5}'
top -bn1 | grep load | awk '{printf "CPU Load: %.2f\n", $(NF-2)}'
# should also try monit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment