Thursday, May 28, 2015

          Enabling and configuring SAR in solaris -10 


SAR ( System Activity Report) is a tool which is very familiar for linux systems for performance analysis. Here i am giving the details for configuring the same in solaris -10

1. First we need to check whether sar is enabled in solaris system or not

#svcs -x system/sar

svc:/system/sar:default (system activity reporting package)
 State: disabled since Wed Apr 16 16:41:41 2014
Reason: Disabled by an administrator.
   See: http://sun.com/msg/SMF-8000-05
   See: sar(1M)
Impact: This service is not running.

2. Now we have to enable the sar in the system

#svcadm enable svc:/system/sar:default


3. Check the status again 

#svcs -x system/sar

svc:/system/sar:default (system activity reporting package)
 State: online since Fri May 15 13:34:38 2015
   See: sar(1M)
   See: /var/svc/log/system-sar:default.log
Impact: None.

4. Now we need to check the crontab entry for the sys

#crontab -l sys
crontab: you are not authorized to use cron.  Sorry.

(this is because sys don't have permission to access the crontab entry so we need to enable the same)

5. Enable the sys for crontab entry by adding sys in /etc/cron.d/cron.allow

6. Now we need to add the below lines in /var/spool/cron/crontabs/sys

0 * * * 0-6 /usr/lib/sa/sa1
20,40 8-17 * * 1-5 /usr/lib/sa/sa1
5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A

7. We can check the crontab entry 

#crontab -l sys
0 * * * 0-6 /usr/lib/sa/sa1
20,40 8-17 * * 1-5 /usr/lib/sa/sa1
5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A

That's it. Now the System Activity Reporter is running every 20 minutes,
and at 18:05 o'clock a daily report is created.