Created
July 23, 2012 21:39
-
-
Save langmi/3166394 to your computer and use it in GitHub Desktop.
shows free and available vps memory on a shared server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# von/from http://devnulled.com/content/2007/06/how-to-display-linux-vps-memory-usage/ | |
bean=`cat /proc/user_beancounters` | |
guar=`echo "$bean" | grep vmguar | awk '{ print $4;}'` | |
burst=`echo "$bean" | grep privvm | awk '{ print $5;}'` | |
priv=`echo "$bean" | grep privvm | awk '{ print $2;}'` | |
let total=guar/256 | |
let used=priv/256 | |
let burst=burst/256 | |
echo "VPS memory usage:" | |
echo "Used: $used MB" | |
echo "Total: $total MB" | |
echo "Burstable to: $burst MB" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment