How to install and Configure sar sysstat tools in Ubuntu Linux


sysstat is the package that you will need to install in order to get the sar

# apt-get install sysstat

Note: After you install the package, you will get the below error as you will need to configure sysstat to collect data.

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

Steps Configure sysstat

  1. Open /etc/default/sysstat configuration file and set the ENABLED flag to true.
    root@ubuntu # nano /etc/default/sysstat
    #
    # Default settings for /etc/init.d/sysstat, /etc/cron.d/sysstat
    # and /etc/cron.daily/sysstat files
    #
    
    # Should sadc collect system activity informations? Valid values
    # are "true" and "false". Please do not put other values, they
    # will be overwritten by debconf!
    ENABLED="true"
    Set sysstat flag to true
  2. Restart the sysstat service
    root@ubuntu # service sysstat restart
     * Starting the system activity data collector sadc

Note: The default setting to collect stats in activity reports is every 10 minutes everyday, you can change it by editing the cron expression in /etc/cron.d/sysstat config file.

-


Have Questions? Post them here!

Topics Coverage:


🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.

Follow Us: GitHub | Facebook | Twitter | Instagram