Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

swap - over 80% in use calculation

807557Feb 11 2010 — edited Feb 12 2010
What 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'
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2010
Added on Feb 11 2010
2 comments
126 views