1823313 Members
3215 Online
109653 Solutions
New Discussion юеВ

Re: SAR report

 
SOLVED
Go to solution
vas  bolpali
Advisor

SAR report

looking for SAR , which will have the following columns only.
%usr %sys %wio %idle %rcache %wcache

no other columns.

Thanks in Advance .
VB.
keeping you ahead of the learning curve
8 REPLIES 8
Christian Gebhardt
Honored Contributor

Re: SAR report

Hi

with "sar -A 1 1" you'll have
more columns. Look at "man sar"

Chris
Keely Jackson
Trusted Contributor

Re: SAR report

Hi

I'm not sure you can. sar -ub is probably about the closest I can think of.

Cheers
Keely
Live long and prosper
vas  bolpali
Advisor

Re: SAR report

I am sorry.
I am looking for 6 columns only.(but it generationg
12 columns. i don't want the other 6 columns),

Thnx,
VB
keeping you ahead of the learning curve
Rita C Workman
Honored Contributor

Re: SAR report

You could do a simple script to direct the output of sar to a temp file. Then 'cut' the fields you want to see and put them in a final file for you to use.

Example:

sar -b 1 1 >> sar.tmp.file
cat sar.tmp.file | cut (fields you want) > sar.final.file

Just a real quick thought,
Rita
vas  bolpali
Advisor

Re: SAR report

Rita,
your info is good.
my 'sar -b' output like this

bread/s lread/s %rcache bwrit/s lwrit/s %wcache pread/s pwrit/s
0 61 100 10 17 41 0 0


I need the output only as followes.

%rcache %wcache
100 41


any body can give exact script?


Thnx,
VB
keeping you ahead of the learning curve
Rita C Workman
Honored Contributor
Solution

Re: SAR report

Okay...try this:

Create a small script...

#!/bin/sh
#
#
sar -b 1 5 > sar.tmp
#
awk ' BEGIN {
while ( "cat '/sar.tmp' " | getline ) {
entries++
if ( $1 ~ "[0-9]" ) printf ("%s", $1 "\t" $4 "\t" $7 "\n") }
} ' >> /sar.file
#


Hope this gives you something to build on..

Rgrds,
Rita
vas  bolpali
Advisor

Re: SAR report

Rita,
Thank You.
U r script is working fine , except that I want to take only the average output for the (SAR -b).
I mean
Script has to be like :
SAR -b 1 5 |grep Average > /sar .. AWK{ } etc.

Can You try to make this work.

thnak you.
VB
keeping you ahead of the learning curve
Rita C Workman
Honored Contributor

Re: SAR report

Than change the script so that
( $1 ~ "Average" )....

That says that if column one has the word Average than print column $1 $4 & $7 or whatever columns you want..

Rgrds,
Rita

....scripting is a good percentage of what we Admins do. You may want to consider taking a course on this (Posix Shell Programming) to help you..I know it helped me.