Operating System - HP-UX
1824638 Members
4580 Online
109672 Solutions
New Discussion юеВ

Refresh my memory (sar/sadc)

 
Richard Briggs
Regular Advisor

Refresh my memory (sar/sadc)

A while back I set up a few of my boxes to run sar and sadc at boot time and create the necessary directories (sa2). I found my start up script that I wrote in /sbin/init.d but for the life of me... I cannot find where it is started @ boot time (symbolic link in the rc#.d). How did I do it? How is sar supposed to be started @ boot time. I know the command syntax, but where is it actually executed in the rc/runtime ? Or better yet, start from scratch: What should I do to have a box create the necessary sar dirs @ boot time?
#find / -name coffee | cup < cream
8 REPLIES 8
Robin Wakefield
Honored Contributor

Re: Refresh my memory (sar/sadc)

Have a look in sys's crontab. Lines such as:

# 0 * * * 0-6 /usr/lib/sa/sa1
# 20,40 8-17 * * 1-5 /usr/lib/sa/sa1
# 5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A

should do the trick.

Robin
Patrick Wallek
Honored Contributor

Re: Refresh my memory (sar/sadc)

I don't know that you'd typically start sar at boot time. Usually you set up sar to run at certain intervals through cron.

You might have a look at roots crontab and see if you see sar running.
Richard Briggs
Regular Advisor

Re: Refresh my memory (sar/sadc)

I have an entry in root's cron (nothing in sys)

0 * * * * /usr/lib/sa/sa1
3 23 * * * /usr/lbin/sa/sa2 -s 6:00 -e 23:01 -i 3600 -A

Here's what I remember though: the second entry in the crontab WON'T work unless something creates (sadc) the necessary date directories @ boot time. I have a script in /sbin/init.d that I wrote called "sars" (attached). But I thought it had to have a ln in one of the rc#.d cirs to execute...but I can't find it? Am I going about it all wrong?
#find / -name coffee | cup < cream
Deshpande Prashant
Honored Contributor

Re: Refresh my memory (sar/sadc)

Hi
Sar should be invoked through crontab for root.
0 * * * * /usr/lbin/sa sa1 1200 3
Should collect data at 20 min. interval
55 23 * * * /usr/lbin/sa/sa2 -s 0:00 -e 23:55 -i 1200 -A
Should create sar report for entire day (00 till 23.55)

Thanks.
Prashant.
Take it as it comes.
Richard Briggs
Regular Advisor

Re: Refresh my memory (sar/sadc)

Deshpande

then why does the /usr/lib/sa/sadc command exist?!
#find / -name coffee | cup < cream
Robin Wakefield
Honored Contributor

Re: Refresh my memory (sar/sadc)

OK - root's crontab should be fine. startup scripts are dealt with in man (1m) sa1

Robin
Richard Briggs
Regular Advisor

Re: Refresh my memory (sar/sadc)

Robin...

I looked at the man page.. but it doesn't mention what runlevel or if the /sbin/init.d script should be symbolically linked.
#find / -name coffee | cup < cream
Deshpande Prashant
Honored Contributor

Re: Refresh my memory (sar/sadc)

Hi
Sa1 and sa2 are the scripts.
sa1 script calls sadc command to collect data.

Thanks.
Prashant Deshpande.
Take it as it comes.