Skip to content

Instantly share code, notes, and snippets.

@JavierJia
Created June 26, 2015 01:01
Show Gist options
  • Save JavierJia/b5f6ef08759eb4abc611 to your computer and use it in GitHub Desktop.
Save JavierJia/b5f6ef08759eb4abc611 to your computer and use it in GitHub Desktop.
How to configure sysstat/sar on Ubuntu/Debian
http://www.leonardoborda.com/blog/how-to-configure-sysstatsar-on-ubuntudebian/
Step 1. Install sysstat
sudo apt-get install sysstat
Step 2. Enable stat collection
sudo vi /etc/default/sysstat
change ENABLED=”false” to ENABLED=”true”
save the file
Step 3. Change the collection interval from every 10 minutes to every 2 minutes.
sudo vi /etc/cron.d/sysstat
Change
5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
To
*/2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
save the file
Step 4. Restart sysstat
sudo service sysstat restart
Step 5. If you want to see all statistics you can type:
sar -A
Step 6. If you want to save the statistics for further analysis to a file use:
sudo sar -A > $(date +`hostname`-%d-%m-%y-%H%M.log)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment