How to install and configure sysstat or SAR

Home > Search > How-to
  by

Use apt-get or yum to install sysstat.

~]# yum install sysstat

 

Start and enable sysstat, and ensure sysstat is active and running.

~]# systemctl start sysstat
~]# systemctl enable sysstat
~]# systemctl status sysstat

 

The /etc/cron.d/sysstat file runs sa1 once every 10 minutes and saves system monitoring data at /var/log/sa/sa##. At 23:53, the /var/log/sa/sa# file is saved to /var/log/sa/sar##.

# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib64/sa/sa1 1 1
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A

 


SAR command

One of the most popular components of sysstat is the SAR command. By default, the SAR command prints the system utilization usage every every 10 minutes and also the system average.

~]# sar
              CPU  %user  %nice  %system  %iowait  %steal  %idle
08:00:01 CDT  all  0.45   0.00    0.11     0.00     0.00   99.34
08:10:01 CDT  all  0.04   0.00    0.00     0.00     0.00   99.96
08:20:01 CDT  all  0.21   0.00    0.00     0.00     0.00   99.79 
average:      all  0.23%  0.00%   0.04%    0.00%    0.00%  99.70%

 

The SAR 1 3 command can be used to get the system average every 1 second 3 times.

~]# sar
              CPU  %user  %nice  %system  %iowait  %steal  %idle
08:00:01 CDT  all  0.45   0.00    0.11     0.00     0.00   99.34
08:00:02 CDT  all  0.04   0.00    0.00     0.00     0.00   99.96
08:00:03 CDT  all  0.21   0.00    0.00     0.00     0.00   99.79 
average:      all  0.23%  0.00%   0.04%    0.00%    0.00%  99.70%

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments