swap - over 80% in use calculation
807557Feb 11 2010 — edited Feb 12 2010What is the easiest method to calculate or find out the total amount of swap on a box - Solaris 8 and 10.
I'd like to take the "swap in use" and "total swap", to see if it's over a certain percentage, say 80%.
I wrote a shell function which does the following, but it does'nt account for the above.
ssgb ()
{
command swap -s | nawk '{gsub(/k/, "")};1' | nawk '{printf "Swap allocated: %.2fGB\nSwap reserved: %.2fGB\nSwap used: %.2fGB\nSwap available: %.2fGB\n", $2/1024/1024, $6/1024/1024, $9/1024/1024, $11/1024/1024}' && swap -s && prtdiag -v | grep 'Memory size'
}