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.

-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author Info:

Rakesh (He/Him) is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap