Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2004-11-30
8
Medium Priority
?
1,018 Views
Last Modified: 2013-12-27


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 ?
0
Comment
Question by:Roshanw4
  • 3
  • 2
6 Comments
 
LVL 38

Accepted Solution

by:
yuzh earned 1000 total points
ID: 12713099
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
 
LVL 38

Expert Comment

by:yuzh
ID: 12713120
also have a look at "How to set up sar":

http://www.sarcheck.com/sarhowto.htm
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 1000 total points
ID: 12720247
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 38

Expert Comment

by:yuzh
ID: 12723391
You can run sar as root !
0
 
LVL 48

Expert Comment

by:Tintin
ID: 12731914
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
 

Expert Comment

by:simplex-tech
ID: 12879429
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month10 days, 10 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question