Operating System - HP-UX
1854863 Members
27912 Online
104104 Solutions
New Discussion

Re: SAR command storing place

 
SOLVED
Go to solution
Anand V
Frequent Advisor

SAR command storing place



Dear Admins,

I just want to clarify the usages and storing location of sar output in details.

Pls educate me in this regards asap.

Thanks & Regards,

Anand
7 REPLIES 7
Oviwan
Honored Contributor
Solution

Re: SAR command storing place

Hey

SDOUT is standard output of sar but you can redirect it to a file:

#sar -d 1 5 >>filename

Hope this helps

Regards
Anand V
Frequent Advisor

Re: SAR command storing place

Dear Oviwan,

Pls note that , your tips helped me lot.

Thanks for your nice help.

But still , i have a query that , where this

output of sar command get stored defaultly.

Can you able to tell this location , so that

i can go there and check on routine basis




similar to checking log messages in /var/adm/syslog/syslog.log messages.

So pls guide me

Thanks & REgards,

Anand
Oviwan
Honored Contributor

Re: SAR command storing place

sar isn't a deamon like syslogd. you have to run sar manually for a specific time and define the output (e.g. a file).

normally you use sar if you have somewhere a bottleneck, to find out where it is.

Re: SAR command storing place

If you want historical sar data, you need to configure accounting (or at least thats what I usually do).

These are my instructions for configuring:

1. Create the following directory

/var/adm/sa

owned by the adm user

2. Add the following entried to the file /usr/spool/cron/crontabs/adm

# adm crontab file for
#
# Run Daily Accounting
0 4 * * 1-6 /usr/sbin/acct/runacct 2> /var/adm/acct/nite/fd2log
#
# Check size of /var/adm/pacct
0 * * * * /usr/sbin/acct/ckpacct
#
# Create summary files
15 5 1 * * /usr/sbin/acct/monacct
#
# Collect system accounting information and store in binary format
0 7-17 * * * /usr/lib/sa/sa1 1200 3
#
# Write a daily report to /var/adm/sa/sadd (where dd is day number)
0 18 * * 1-6 /usr/lib/sa/sa2 -s 7:00 -e 18:01 -i 3600 -A
#
# Disk Accounting
0 2 * * 4 /usr/sbin/acct/dodisk

3. Remove all comment fields from /etc/fstab (otherwise some of the scripts in the crontab above will error)

4. Set flag to 1 in /etc/rc.config.d/acct, as follows:

#!/sbin/sh
# @(#) $Revision: 72.5 $
# Process accounting. See acct(1m)
#
# START_ACCT: Set to 1 to start process accounting
#
START_ACCT=1

5. To prevent erroeneous e-mails from the cron daemon, comment out the 2 â dateâ commands in /usr/sbin/acct/dodisk.

6 Set up /etc/acct/holidays, file with data for the current year.

7. Run:

/sbin/init.d/acct start


Now after some data is collected you will be able to run sar without specifying iterations and intervals and see some summary data

e.g. instead of 'sar -u 2 2' you could just run 'sar -u' to summarise data for today (9 August), or 'sar -u -f /var/adm/sa/sa08' to see data for yesterday (8 August)

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Anand V
Frequent Advisor

Re: SAR command storing place



Dear Oviwan

Thanks for your help.

Thanks & Regards,

Anand
Anand V
Frequent Advisor

Re: SAR command storing place



Dear DUncan

Your idea helped me lot. I need to implement it.I am waiting for confirmation.

If problem some presists , will update you.

Thanks & REgards,

Anand
Anand V
Frequent Advisor

Re: SAR command storing place

Thanks to all Unix Masters