Operating System - HP-UX
1748215 Members
3493 Online
108759 Solutions
New Discussion юеВ

Re: Can you retrieve sar data for one disk device?

 
SOLVED
Go to solution
Geoff Wild
Honored Contributor

Can you retrieve sar data for one disk device?

Is there a way on the command line to do this? I checked man, doesn't look like it...

I'm currently running something like:

sar -d -s 00:00 -e 04:00 -f /var/adm/sa/sa26

but I have 264 devices!!! - and it is a pain to manually go through the data to look at one disk...

Yes, I can awk/grep - but I also need the time stamp....which is only displayed on the first disk of that period...

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.
12 REPLIES 12
James R. Ferguson
Acclaimed Contributor

Re: Can you retrieve sar data for one disk device?

Hi Geoff:

How about:

# perl -lne 'if (m/(\d\d:\d\d:\d\d)/) {$t=$1};if (m/DEVICE/) {print $t,$_}' /var/adm/sa/sa26

Modify DEVICE to match your disk of interest.

Regards!

...JRF...
baiju_3
Esteemed Contributor

Re: Can you retrieve sar data for one disk device?

Hi Geoff,

Can iostat be used to get the information ?.


Regards,
bl.



Good things Just Got better (Plz,not stolen from advertisement -:) )
Geoff Wild
Honored Contributor

Re: Can you retrieve sar data for one disk device?

James...

Doesn't seem to grab anything:

perl -lne 'if (m/(\d\d:\d\d:\d\d)/) {$t=$1};if (m/c62t0d2/) {print $t,$_}' /var/adm/sa/sa20

returns blank...

But it is there:

sar -d -s 00:00 -e 04:00 -f /var/adm/sa/sa20 |grep c62t0d2
c62t0d2 1.79 0.50 13 526 4.98 1.71
c62t0d2 1.66 0.50 11 464 5.12 1.82
c62t0d2 1.39 0.50 10 412 5.04 1.74
c62t0d2 0.66 0.50 9 274 5.13 0.73
c62t0d2 1.44 0.50 10 432 5.02 1.82
c62t0d2 1.25 0.50 8 361 4.95 1.87
c62t0d2 1.65 0.50 8 373 5.04 2.78
c62t0d2 0.77 0.50 3 337 4.96 2.89
c62t0d2 0.56 0.50 1 126 5.11 4.18
c62t0d2 1.52 0.50 5 252 5.00 4.42
c62t0d2 0.90 0.50 5 162 5.07 1.94
c62t0d2 1.60 0.50 7 309 5.03 2.98
c62t0d2 0.51 0.50 4 149 5.00 1.32
c62t0d2 1.64 0.50 7 377 5.01 3.06
c62t0d2 1.00 0.50 5 270 5.07 2.48
c62t0d2 3.09 0.50 17 769 5.07 2.28
c62t0d2 2.39 0.50 15 634 5.01 1.82
c62t0d2 2.77 0.50 15 686 4.98 2.40
c62t0d2 1.63 0.50 8 468 4.97 2.28
c62t0d2 1.13 0.50 5 288 4.97 2.65
c62t0d2 0.40 0.50 5 150 5.03 0.78
c62t0d2 0.55 0.50 7 195 5.06 0.77
c62t0d2 0.80 0.50 6 256 4.98 1.75
Average c62t0d2 1.30 0.50 8 345 5.02 2.06


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.
Steven E. Protter
Exalted Contributor

Re: Can you retrieve sar data for one disk device?

Shalom Geoff

I'd reccommend this:
http://www.hpux.ws/system.perf.sh

But!!!!

Before looking at the disk stuff, grep it.

It would be easy enough to actually modify the above programs to monitor only certain devices, but I'd like to have the data and fileter it after the fact.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Geoff Wild
Honored Contributor

Re: Can you retrieve sar data for one disk device?

Steven - is your site down or is it just me?

http://www.hpux.ws/

Cannot find server or DNS Error

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.
Hein van den Heuvel
Honored Contributor

Re: Can you retrieve sar data for one disk device?

Hey Geoff,

Hope you are well. Orlando seems a long time ago.

Anyway,

Check out the following prior discussion:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=988904

It seems to solve much similar problems.

Regards,

Hein.
James R. Ferguson
Acclaimed Contributor

Re: Can you retrieve sar data for one disk device?

Hi Geoff:

Well, could you post a snippet of your output?

It works for me when doing:

# sar -d 5 5||perl -lne 'if (m/(\d\d:\d\d:\d\d)/) {$t=$1};if (m/cXtYdZ/) {print $t,$_}'

Regards!

...JRF...
Geoff Wild
Honored Contributor

Re: Can you retrieve sar data for one disk device?

James,

did you mean two pipes from sar?

sar -d 5 5||perl -lne 'if (m/(\d\d:\d\d:\d\d)/) {$t=$1};if (m/c62t0d2/) {print $t,$_}'

Returns everything...

Or one:

sar -d 5 5|perl -lne 'if (m/(\d\d:\d\d:\d\d)/) {$t=$1};if (m/c62t0d2/) {print $t,$_}'
10:53:08 c62t0d2 0.20 0.50 4 141 5.34 0.57
10:53:18 c62t0d2 0.20 0.50 5 128 3.55 0.48
10:53:23 c62t0d2 0.20 0.50 2 61 6.22 0.39
10:53:28Average c62t0d2 0.12 0.50 2 66 4.71 0.50

One pipe worked...


But I must say - Doug O'Leary's script in the link in the post that my good friend Hein posted above works great!

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.
James R. Ferguson
Acclaimed Contributor

Re: Can you retrieve sar data for one disk device?

Hi Geoff:

One pipe. I just can't type today :-))

BTW, the problem with the daily files is that they are binary files, hence require some more special treatment. Ooops.

Regards!

...JRF...