How to Enable SAR on Solaris

If sar is enabled on your Solaris 9 or 10 box, but does not seem to be recording any data, check the following.

Check the cron log /var/cron/log for errors like this:

! bad user (sys) Tue Apr 27 08:30:00 2012

To fix the error, just edit /etc/shadow and replace “*LK*” in the password field with “*NP*“. Sar does not like *LK*.

Edit and uncomment “s1” and perhaps “s2” jobs in the sys crontab. Use “crontab -e sys” as root. Do not edit the crontab file directly, or cron will be unaware of the update and will not read in the crontab file.

If crontab -e sys says “you are not allowed to use cron”, edit the file /usr/lib/cron/cron.allow and add “sys”.

On Solaris 9, edit the file /etc/rc2.d/S21perf and uncomment all commands therein. A special sar record will then be generated at every system boot.

On Solaris 10, enable the sar service as follows. Solaris 10 does not have the S21perf startup file.

svcadm enable system/sar

That’s it. Check the space available in /var and that it is not (likely to be) filled up by sar records. Check again a few days later. The volume of data generated by sar can vary greatly depending on your system. It is often very large for systems with a lot of SAN disks attached.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.