I find it important to track the swapout rates of my UNIX machines, almost as much as it is to track the total swap. Thankfully, vmstat returns these results quite nicely. Linux and Solaris 10 use two different columns (8 and 9 respectively), hence the two different versions:
The rateavg is the average swapout rate since your machine last booted, at least according to the vmstat documentation. Enjoy!
Code:
UserParameter=linuxswap[rate5s],vmstat 5 2 | awk '{ print $8 }' | tail -1
UserParameter=linuxswap[rateavg],vmstat | awk '{ print $8 }' | tail -1
UserParameter=solswap[rate5s],vmstat 5 2 | awk '{ print $9 }' | tail -1
UserParameter=solswap[rateavg],vmstat | awk '{ print $9 }' | tail -1


Comment