Linux vmstat Recipe

  1. Run vmstat in the background with a 1 second interval:
    nohup vmstat -tnw 1 > diag_vmstat_$(hostname)_$(date +%Y%m%d_%H%M%S).txt &
    1. Some older versions of Linux do not support the -t or -w flags.
  2. Reproduce the problem.
  3. To stop collection, kill the vmstat process. For example:
    pkill -TERM -f "vmstat -tnw"
  4. Upload diag_vmstat_* and nohup.out

For background, see Linux vmstat.