How to automate the sar to get the history in /var/adm/sa



Hi

I have solaris 8 server . i need to get last night sar output but ny server is not automated for taking the sar history how can i do it.

How do i automate the sar to get the history in /var/adm/sa

Is there any command other than puting it in the cron ?
Roshanw4Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yuzhCommented:
You can put something like the following in the crontab:

5,35 * * * * /usr/lib/sa/sa1 >/dev/null 2>&1

use need to login as root or su as root, then type in:

EDITOR=vi
export EDITOR
ccrontab -e

in vi mode, add
5,35 * * * * /usr/lib/sa/sa1 >/dev/null 2>&1

save and exit from vi

man crontab
man sar
to learn more details.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yuzhCommented:
also have a look at "How to set up sar":

http://www.sarcheck.com/sarhowto.htm
0
TintinCommented:
yuhz.

sar crontab runs under the 'sys' user, so you'd want to do

crontab -e sys

and uncomment (and optionally change the frequency) of the sa jobs.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

yuzhCommented:
You can run sar as root !
0
TintinCommented:
You *can* run sar as root, but the default on Solaris is to run as the 'sys' user.  The sys user crontab already has sar entries in it that just need uncommenting to enable.
0
simplex-techCommented:
Edit the sys crontab and un-comment the entries for sar.  

(make sure the vi is your default editor or things get ugly)

crontab -e sys

There will be some lines in there for sar... If I remember correctly 3 lines.... uncomment then and you're done.... sar will begin collecting stats.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.