I'm trying to obtain counters for swap-in/swap-out activity on CentOS 6. The intention is to feed raw data into RRDtool to generate graphs, and use it to generate alerts. I've had a look at common tools (
dstat), but these all seem aimed at interactive use, ie "from this point on" rather than providing raw access to counters.
sar is running on the system, and can generate historical reports, but doesn't seem like it tracks counters of swap-in/swap-out activity.
The /proc manpage seems to indicate raw counters are available via
page 5741 1808 The number of pages the system paged in and the number that were paged out (from disk).
But that line is not present in the contents of
/proc/stat on this system (kernel 2.6.32). I'd prefer raw counters to avoid running/looping background processes like
vmstat. Looking at the contents of free isn't ideal, as it only shows percent used at a single point in time, not total activity since the last reading.