Operating System - HP-UX
1824993 Members
2164 Online
109678 Solutions
New Discussion юеВ

sar command doesn't run correctly

 
SOLVED
Go to solution
Marco_67
Advisor

sar command doesn't run correctly

Hello,

I'm getting the following error when running sar command.
sar: Can't open /var/adm/sa/sa19
That sa directory structure is missing on my system (11.11), what's wrong ?
Should I configure sar in advance ?


0
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor
Solution

Re: sar command doesn't run correctly

Hi Marco,

could you check for the line

/var/spool/cron/crontabs# crontab -l sys
#
# -- SAR informatie
#
0,5,10,15,20,25,30,35,40,45,50,55 * * * 0-6 /usr/lib/sa/sa1

Regards,
Robert-Jan
Marco_67
Advisor

Re: sar command doesn't run correctly

Hi Robert,

that line is missing on my crontab...
Should I add it ?
What does it do ?

Thanks for the moment
0
Dave Hutton
Honored Contributor

Re: sar command doesn't run correctly

Typing "sar" at the command prompt gives you the last 24 hours of history. Like Robert-Jan suggests if you want to type sar without that error to see the last 24 hours. You have to set up that crontab entry so it collects the information.
Otherwise if you are just trying to see current system stats. You need flags on it for example:
# sar -v 5 100

(Theres quite a few so you'll want to check ou the man page.)
Gopi Sekar
Honored Contributor

Re: sar command doesn't run correctly


are you trying to run sar manually from command prompt?

you system does not have /var/adm/sa directory, create it and see whether sar runs properly

also, looks like your crontab is not configured with sar to run automatically, you can add the crontab line mentioned so that it can run automatically to collect system statistics periodically


Regards,
Gopi
Never Never Never Giveup
Devender Khatana
Honored Contributor

Re: sar command doesn't run correctly

Hi,

If you have not configured it is crontab and give sar at command prompt and get this error, this is perhaps because you are not providing any arguments to it.

On my system :-
iocbk101:/tmp/som>>sar
sar: Can't open /var/adm/sa/sa19

iocbk101:/tmp/som>>sar 1 11111

HP-UX iocbk101 B.11.11 U 9000/800 05/19/05

22:46:05 %usr %sys %wio %idle
22:46:06 9 56 35 0
22:46:07 8 61 31 0
22:46:08 8 72 20 0
22:46:09 10 65 25 0
22:46:10 10 69 21 0

HTH,
Devender
Impossible itself mentions "I m possible"
Rafi Sheikh
Occasional Contributor

Re: sar command doesn't run correctly

It could simply be that you are not placing the t & n with the command (time interval and number of obs)

Geoff Wild
Honored Contributor

Re: sar command doesn't run correctly

Yes - you need to create the directory structure and then setup sar:

mkdir /var/adm/sa/

The in root's cron, something like:

#
# SAR - for sarcheck
0 * * * * /usr/lib/sa/sa1
10,20,30,40,50 * * * * /usr/lib/sa/sa1
# reduce the sar data
5 19 * * * /usr/lib/sa/sa2 -s 5:00 -e 19:01 -i 600 -A


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.