Wednesday, April 16, 2014

How to enable sar on linux (Redhat)

How to enable SAR

1. Install the sysstat package.
# yum -y install sysstat

2. Edit the config file,
# vi /etc/sysconfig/sysstat
SADC_OPTIONS="-d"

3. Verify the change.
# cat /etc/sysconfig/sysstat

4. Make sure it starts upon rebot.
# chkconfig sysstat on
# service sysstat start
# chkconfig --list |grep sys

5. Add entry to cron

# crontab -e
# Activity reports on every 10 minutes intervals everyday
*/10 * * * * root [ -x /usr/lib64/sa/sa1 ] && exec /usr/lib64/sa/sa1 -S ALL 1 1

# Updates the report on every 6 hours
55 5,11,17,23 * * * root [ -x /usr/lib64/sa/sa2 ] && exec /usr/lib64/sa/sa2 -A

6. Log is stored at
# cd /var/log/sa

No comments:

Post a Comment