Operating System - HP-UX
1837090 Members
2731 Online
110112 Solutions
New Discussion

Re: system activity report thru 'sadc'

 
Deepu Chakravarty
Regular Advisor

system activity report thru 'sadc'

how to take a system activity report thru 'sadc' which should run every five mins, daily and starting today with file in /var/adm/sa
5 REPLIES 5
Pete Randall
Outstanding Contributor

Re: system activity report thru 'sadc'

Do a man on sa1:

"The shell script sa1, a variant of sadc, is used to collect and store data in binary file /var/adm/sa/sadd where dd is the current day. The arguments t and n cause records to be written n times at an interval of t seconds, or once if omitted. The following entries, if placed in crontab, produce records every 20 minutes during working hours and hourly otherwise (see cron(1M)):

0 * * * 0,6 /usr/lbin/sa/sa1
0 8-17 * * 1-5 /usr/lbin/sa/sa1 1200 3
0 18-7 * * 1-5 /usr/lbin/sa/sa1
"


Pete

Pete
Deepu Chakravarty
Regular Advisor

Re: system activity report thru 'sadc'

I have seen the man page on sadc. How to put the report in a date file ? So that if I do 'sar' then current date's data should be displayed.

Can u give me exact command ?
Alzhy
Honored Contributor

Re: system activity report thru 'sadc'

You will need to create the directory "/var/adm/sa". If you do not have that directory, you won't have SAR stats gathering -- even if you have it in sys or root's crontab as described above.

Note that once set up, merely typing sar will show you the current day's statistics up to the last minute ( or 5 minutes depending on how you set up sadc or the sa1 script. sadc/sa1 also automatically names the sar file suffixed with the day of the month ie: /var/adm/sa/sa01~saNN. To get to a prevous day's sar stats, simply do:

sar -f /var/adm/sa/saNN [options]


HTH

Hakuna Matata.
Deepu Chakravarty
Regular Advisor

Re: system activity report thru 'sadc'

Hi,
I have created the directory(sa) under /var/adm. I submitted cron job as following
0 * * * 1-6 /usr/lbin/sa/sa1 300

But no file is creating in /var/adm/sa.

Alzhy
Honored Contributor

Re: system activity report thru 'sadc'

Deepu,

You've go the wrong path to the sa1 script. The correct path is /usr/lib/sa/sa1

HTH!
Hakuna Matata.