1834713 Members
2267 Online
110069 Solutions
New Discussion

Collect for sar1 / sa2

 

Collect for sar1 / sa2

Hello everybody,

In my crontab there are the entries for the sar command:

0 * * * * /usr/lbin/sa/sa1
59 23 * * * /usr/lbin/sa/sa2 -s 0:01 -e 23:59 -i 300 -A

The problem is the sa2 not run becase permission problems. I set the permissions for 555, but the files in the /var/adm/sa not be format (sardd).

How I do for format the files collect previously?

Regards and Thanks for all.

Andr??

P.S. Sorry for the english
Andre Augusto
3 REPLIES 3
Uday_S_Ankolekar
Honored Contributor

Re: Collect for sar1 / sa2

Hello,

You can sar with -d option..

sar -d /var/adm/sa/sadates.

-USA..
Good Luck..
Sanjay_6
Honored Contributor

Re: Collect for sar1 / sa2

Hi Andre,

This is what the sar cron job looks like on my system,

0,5,10,15,20,25,30,35,40,45,50,55 * * * 0-6 /usr/lib/sa/sa1
57 23 * * 0-6 /usr/lib/sa/sa2 -s 0:00 -e 23:55 -i 300 -A

/usr/lib/sa/sa1

#! /usr/bin/sh
# @(#) $Revision: 72.3 $
# sa1.sh

DATE=`date +%d`
ENDIR=/usr/lbin/sa
DFILE=/var/adm/sa/sa$DATE
cd $ENDIR
if [ $# = 0 ]
then
exec $ENDIR/sadc 1 1 $DFILE
else
exec $ENDIR/sadc $* $DFILE

/usr/lib/sa/sa2

#! /usr/bin/sh
# @(#) $Revision: 72.1 $
# sa2.sh

DATE=`date +%d`
RPT=/var/adm/sa/sar$DATE
DFILE=/var/adm/sa/sa$DATE
ENDIR=/usr/sbin
cd $ENDIR
$ENDIR/sar $* -f $DFILE > $RPT
find /var/adm/sa \( -name 'sar*' -o -name 'sa*' \) -mtime +7 -exec rm {} \;

Do the daily sa files exist under /var/adm/sa

Hope this helps.

Regds

Re: Collect for sar1 / sa2

I do a copy of file sa2 to my home directory and change the DATE variable to "30". I run the program and the file sar30 was format like I want (/usr/lbin/sa/sa2 -s 0:01 -e 23:59 -i 300 -A).

Thanks for Sanjay and Uday for yours help.

Hugs for all.

Andr??

Phrase of the year: "Todo mundo inventa mas s?? o Brasil pode ser Penta"

Andre Augusto