Unix Shell - running sar

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > March 2004 > running sar





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author running sar
Joe Philip

2004-03-23, 12:38 pm

In our HP-UX 11.11 box, sar data is generated in a slightly diferent name
formatted file like /var/adm/sa/sa0323 - usually it is sa#dd; but in our
case it is sa#mmdd. I guess it is set by the script /usr/lbin/sa/sa1.

So, when I do
sar -u , sar complains that /var/adm/sa/sa23 is not found. I can un like
sar -u -f /var/adm/sa/sa0323.

However, I want to avoid typing the full file name every time I run the sar
ie, I just want to run sar as:
sar -u
or sar -d etc without the filename?

How do I do that?


Arvid Oja

2004-03-24, 3:35 am

"Joe Philip" <joe.philip@verizon.net> wrote in message news:<Ul_7c.3729$Uh5.2200@nwrdny01.gnilink.net>...
> In our HP-UX 11.11 box, sar data is generated in a slightly diferent name
> formatted file like /var/adm/sa/sa0323 - usually it is sa#dd; but in our
> case it is sa#mmdd. I guess it is set by the script /usr/lbin/sa/sa1.
>
> So, when I do
> sar -u , sar complains that /var/adm/sa/sa23 is not found. I can un like
> sar -u -f /var/adm/sa/sa0323.
>
> However, I want to avoid typing the full file name every time I run the sar
> ie, I just want to run sar as:
> sar -u
> or sar -d etc without the filename?
>
> How do I do that?


On a Sun box, the script /usr/lib/sa/sa1 includes the sa-file format:

> DATE=`/usr/bin/date +%d`


I assume on your HP box the script /usr/lbin/sa/sa1 would read
DATE=`/usr/bin/date +%m%d`. If so, just remove the %m.

This way you will of course only have sa-files for no longer period
than one month.

Arvid
Joe Philip

2004-03-24, 7:35 am

Yes, /usr/lbin/sa/sa1 script is set ro read with %m%d format. However, I do
not have the privilege to make any changes to it. How should I proceed?


"Arvid Oja" <arvid.oja@spray.se> wrote in message
news:85f4d53b.0403240024.4b6d92d0@posting.google.com...
> "Joe Philip" <joe.philip@verizon.net> wrote in message

news:<Ul_7c.3729$Uh5.2200@nwrdny01.gnilink.net>...
name[color=darkred]
like[color=darkred]
sar[color=darkred]
>
> On a Sun box, the script /usr/lib/sa/sa1 includes the sa-file format:
>
>
> I assume on your HP box the script /usr/lbin/sa/sa1 would read
> DATE=`/usr/bin/date +%m%d`. If so, just remove the %m.
>
> This way you will of course only have sa-files for no longer period
> than one month.
>
> Arvid



Arvid Oja

2004-03-25, 4:42 am

> Yes, /usr/lbin/sa/sa1 script is set ro read with %m%d format. However, I do[color=darkred]
> not have the privilege to make any changes to it. How should I proceed?
>
>
> "Arvid Oja" <arvid.oja@spray.se> wrote in message

Er, I guess you could create a script on your path (named sars?),
something like:

#!/bin/ksh
day=`date "+%m%d"`
sar -f /var/adm/sa/sa$day $@

Then just run "sars" with the appropriate arguments. Of course, if you
would want to run the -f argument, you would need to either run "sar"
or add the mechanism to handle it in the script.

Arvid
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com