1825801 Members
2718 Online
109687 Solutions
New Discussion

sar mi

 
SOLVED
Go to solution

sar mi

Hi,
sar -d produces under 11.11 the following error:
sar: Can't open /var/adm/sa/sa23
Does anybody know how to fix it?
There is actually no /var/adm/sa at all.
Thanks,
fd
7 REPLIES 7
Ermin Borovac
Honored Contributor

Re: sar mi

If you run sar without sampling interval it will try to retrieve previously recorded data from /var/adm/sa/sa23 (which you don't have as you haven't saved any).

sar -d 5 5

will sample disk performance data in 5 intervals of 5 seconds.
Dave Olker
Neighborhood Moderator

Re: sar mi

Hi Fernando,

Try using sar like this:

# sar -d


I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
Franky_1
Respected Contributor

Re: sar mi

Hi,

this works only if you've implemented the sar reporting (using sa2) in crontab
For example :

5 18 * * 1-5 /usr/lbin/sa/sa2 -s 8:00 -e 18:01 -i 3600 -A

This will produce the files under /var/adm/sa/sa

Otherwise you can just enter sar -d 2 3
(which stands for the time and the interval)

Regards

Franky
Don't worry be happy

Re: sar mi

Hi,
thanks for your help. But it didn`t work.
(root@taktt1):/>sar -d 5 5

HP-UX taktt1 B.11.11 U 9000/800 08/23/04

08:22:22 device %busy avque r+w/s blks/s avwait avserv
08:22:27 c1t15d0 0.20 0.50 0 3 0.12 11.22
08:22:32 c1t15d0 0.80 0.50 1 4 0.25 14.52
08:22:37
08:22:42 c1t15d0 0.60 0.50 1 2 0.16 12.20
08:22:47 c1t15d0 1.20 0.50 2 11 1.43 13.41

Average c1t15d0 0.56 0.50 1 4 0.75 13.46
(root@taktt1):/>sar -d
sar: Can't open /var/adm/sa/sa23
(root@taktt1):/>/usr/lbin/sa/sa2 -s 8:00 -e 18:01 -i 3600 -A
/usr/lbin/sa/sa2[9]: /var/adm/sa/sar23: Cannot create the specified file.
find: cannot stat /var/adm/sa
Franky_1
Respected Contributor

Re: sar mi

Hi,

the output of sar -d 5 5 seems to be ok - five times repeated and an interval of 5 minutes

The sa2 command described only works when implemented as cronjob not from the command line (crontab -e)

Regards

Franky
Don't worry be happy

Re: sar mi

Hi,
thanks a lot. I also put it in cron but it didn`t work out. Actually the problem was the lack of /var/adm/sa. After manually creating /var/adm/sa it works. Sar creates itself a sa23 file.
Thanks you all for your assistance,
Fernando
Elmar P. Kolkman
Honored Contributor
Solution

Re: sar mi

Normally, when running sar from cron, the entry will be something like:
0 * * * * /usr/lbin/sa1 300 12

(Running every 300 seconds and collect 12 samples, meaning run for 1 hour and collect a sample every 5 minutes. Cron will start this every hour.)

sa1 (or sadc) is the way to call the datacollector.
sa2 is a script that uses collected data to be written in human readable form.

And yes, you need the directory /var/adm/sa and have to create it manually if not present yet.
Every problem has at least one solution. Only some solutions are harder to find.