How to install & configure SAR on CentOS/RHEL

Sunday, February 12, 2017

How to install & configure SAR on CentOS/RHEL:-

SAR (System Activity Reporter) is an important tool that helps system administrator to get a review of the server box with status of different critical metrics at different points of time. Using sar command you can monitor performance of different Linux subsystems (CPU, Memory, I/O etc..) in real time. The sar command extracts and write to standard output records previously saved in a file.

How To Install SAR:-

You can install it using YUM command. Use following command to install SAR.

# yum install sysstat


How To Check SAR :-

Once installed, verify the sar version using following command:

# sar -V
 
sysstat version 9.0.4
(C) Sebastien Godard (sysstat  orange.fr)

Collect the statistics using cron job :-

Create sysstat file under /etc/cron.d directory that will collect the historical sar data.

# cat /etc/cron.d/sysstat

# Run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib64/sa/sa1 1 1
# 0 * * * * root /usr/lib64/sa/sa1 600 6 &
# Generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib64/sa/sa2 -A

1. So the first cron entry will run every 10 minutes which will call the sadc utility and collect system stats and store it in a binary file.
2. And the second cron entry will dump all the contents of that binary file into another text file.

By default 7 days statistics, So you can modify that HISTORY entry easily by editing the file.

# cat /etc/sysconfig/sysstat

# How long to keep log files (in days).
# If value is greater than 28, then log files are kept in
# multiple directories, one for each month.
HISTORY=28

By default all the statistics will save /var/log/sa location.

# cd /var/log/sa
 

1 comments:

daelkabir March 3, 2022 at 9:33 PM  

Top 5 best slots online - JTGHub
Casino 천안 출장안마 Slot Machines. Top 5 Best slots online. Casino 태백 출장안마 Slot Machines - Best slots online. Casino Slot Machines 영주 출장마사지 - 안산 출장마사지 Best slots 제주 출장마사지 online. Casino Slot Machines - Best slots

About This Blog

Lorem Ipsum

  © Copyright 2009 Linux-HelpLine.Blogspot.com

Back to TOP