Simple steps to install and configure sar (sysstat) on Ubuntu/Debian servers

Monitoring servers are very important for every server administrators. There are some command line tools are available to monitor server resource usages. The Sar or Sysstat is one of the great command-line tool to monitor the server resource usage.

We can simply find the resource usage history by using the command “sar” with switches like ‘q’, ‘r’ etc..

>> Load & Memory monitoring using SAR <<

A lot of switches are available with “sar” command to check different things. Here, CryBit explains the basic installation steps of sar on Debian servers.

Installation of SAR on Ubuntu/Debian

We can simply install and configure the SAR on Linux servers. In debian based server we can use the command “apt-get” to install the SAR utility.

Step I : SSH to the server as root user.

Step II : Execute the below command to install the SAR utility.

# apt-get install sysstat

That’s it! You may get the below pasted error if you are not configured the sysstat properly.

Cannot open /var/log/sysstat/sa02: No such file or directory
Please check if data collecting is enabled in /etc/default/sysstat


Open “/etc/default/sysstat” using your favorite file editor and change ENABLED=”false” to ENABLED=”true”

vi /etc/default/sysstat
# Should sadc collect system activity informations? Valid values
# are "true" and "false". Please do not put other values, they
# will be overwritten by debconf!

Step III : One more thing to do, change the collection interval from every 10 minutes to every 2 minutes.

vi /etc/cron.d/sysstat
5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
*/2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1


Step IV : Restart the service.

service sysstat restart
/etc/init.d/sysstat restart

That’s it!  Install SAR and relax 🙂

Related Links:

1, Load & Memory monitoring using SAR
2, Load monitoring in Linux servers

Arunlal Ashok

Linux Server Administrator. I'm managing Linux servers since 2012. I started this blog to share and discuss my ideas. Check My Profile!! in uPwork (oDesk) and let me know if you need any assistance. Thanks!!

You may also like...

13 Responses

  1. Manoj Gupta says:

    How to send this SAR report to automatically on my email id ?

  2. Zeeshan says:

    I did this on Amazon EC2 Ubuntu virtual machine. It worked perfectly. I didn’t need to restart sysstat service.

  3. guru says:

    I am using CentOS Linux release 7 and i am not finding /etc/default/sysstat file for enabling data collection.
    Please help me where exaclty i have to enable as ENABLED=”true”?

  4. Cris says:

    Awesome post!!! Extremely helpful!!! Thank you so much!!!

  5. Ahmed Refaey says:


  6. João Pinela. says:

    very nice post and explanation.
    screenshots are a great helper.

  7. Roger Pack says:

    You may want to mention the “No such file or directory” failure can occur if you run the “sar” command (i.e. test it by running sar once).

  8. talo says:

    Cool!, just what i needed 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *