Linux vmstat Recipe
- Run vmstat in the background with a 5 second interval:
sh -c "date >> nohup.out && (nohup vmstat -tn 5 > diag_vmstat_$(hostname)_$(date +%Y%m%d_%H%M%S).txt &); sleep 1; cat nohup.out" - Check for any errors running the above commands in your terminal.
Some versions of Linux do not support the
-tflag so the above command will give an error. If so, change to-n. - Reproduce the problem.
- To stop collection, kill the vmstat process. For example:
pkill -f vmstat - Upload
diag_vmstat_*andnohup.out
For background, see Linux vmstat.