1834628 Members
2859 Online
110069 Solutions
New Discussion

sar on HP-UX

 
Chris Anoruo_1
Frequent Advisor

sar on HP-UX

The sar command on HP-Ux does not give required output as from an AT&T version
of unix. Please can someone throw some light on this and how to resolve this.
When I use $sar -b at unix command prompt I get the error message "Sar: Can't
open /var/adm/sa/sa22" same as when I use root, but on an AT&T unix box it
gives me the values for every 20 minutes since boot up.
4 REPLIES 4
Chris Anoruo_1
Frequent Advisor

Re: sar on HP-UX

I KNOW I CAN GET RESULTS WITH SAR 5 7. BUT WHY CANN'T SAR GIVE THE EXPECTED
OUTPUT?
Victor Berridge_1
Occasional Advisor

Re: sar on HP-UX

Hello,

open
/var/adm/sa/sa22" >
The system is looking for the file /var/adm/sa/sa22
22 means today (format saDD)
I suppose you have no /var/adm/sa/
So:
var/adm>mkdir sa
alphard:..var/adm> /usr/lbin/sa/sadc \ var/adm/sa/sa`date +%d`
alphard:..var/adm>sar -b
18:46:03 HP-UX restarts

HP-UX alphard B.11.00 E 9000/813 03/22/00

bread/s lread/s %rcache bwrit/s lwrit/s %wcache pread/s pwrit/s

Hope I have helped a little
Regards
Victor
Ajay Singh_4
Occasional Contributor

Re: sar on HP-UX

Just Do a man on Sar Command
acctually you need to give Time interval, its required not optional
eg. sar -b 5 5 or sar -b 5 (for 5 sec. interval)
Alan Riggs_1
Regular Advisor

Re: sar on HP-UX

Please don't shout. If you want to be able to acess sar history reports rather
than use the utility for interactive real-time data gathering then you need to
configure entries in cron to gather and format the information appropriately.
For instance, to gather data every 15 minutes during business hours and every
20 minutes off hours you might use:

0 8-17 * * 1-5 /usr/lbin/sa/sa1 900 4
0 18-7 * * 1-5 /usr/lbin/sa/sa1 1200 3
0 * * * 0,6 /usr/lbin/sa/sa1 1200 3
45 23 * * 1-5 /usr/lbin/sa/sa2 -s 00:00 -e 23:30 -i 3600 -A

Please see man sa1 & man sa2 for details on how these scripts function. The
default location for file output is /var/adm/sa, so this directory should exist
and be writable to the sa utilities.