Register now and start sharing your code snippets.
-->

How to install sar on Debian

Shell Script (Bash) posted 6 months ago by christian

First install the sysstat package which includes sar:

   1  apt-get install sysstat

Then run crontab -e and add the following to collect stats:

   1  # Collect measurements at 10-minute intervals
   2  0,10,20,30,40,50   * * * *   /usr/lib/sa/sa1
   3  # Create daily reports and purge old files
   4  0                  0 * * *   /usr/lib/sa/sa2 -A

You now have access to IO and CPU usage history.

Tagged io, cpu, sar, usage, report, debian, linux