Formatting SCSI log page

From: James Thompson (mezron@HOTMAIL.COM)
Date: Tue Oct 08 2002 - 11:16:35 EDT


I need some help taking a scsi logpage and converting it to a report that is
easy to read. For example the LTO drive compression log page looks like
this.

Issuing log sense for page 0x32...

Log Sense Page 0x32, Page Length 80, Data, Length 80

            0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
    0000 - 3200 004C 0000 4002 00C8 0001 4002 00C8
[2..L..@..╚..@..╚]
    0010 - 0002 4004 0000 003C 0003 4004 FFF8 0000 [..@....<..@. °..]
    0020 - 0004 4004 0000 001E 0005 4004 FFFA 8D70 [..@.......@. ·ìp]
    0030 - 0006 4004 0000 003C 0007 4004 0000 0000 [..@....<..@.....]
    0040 - 0008 4004 0000 001E 0009 4004 FFFE 8A40 [..@.......@. &#9632;è@]

The first three parameters have the following characteristics ( I won't list
them all for sake of some brevity).

0 Read Compression ratio ×100 2 0 0 0
1 Write Compression Ratio ×100 2 0 0 0
2 Megabytes transferred to host 4 0 0 0

The first parameter has a value of C8 (0000 4002 00C8) as does the second
paramter (0001 4002 00C8). The third parameter has a value of 3C (0002 4004
0000 003C).

I'm a novice script writer and can do basic grep, awk, perl, and korn shell.
  I've used the following command to try and get just the parameters, but
I'm struggling after that.

cat log3a | grep '[0-9A-F]\{4\} [0-9A-F]\{4\}' | awk '{print $3 $4 $5 $6 $7
$8 $9 $10 }'

I'm not sure if I should try and strip the newline characters out of that
output, or just feed it into a perl script and start working on it.

The end result is I want to be able to output a report that says.
Read Compression Ratio x 100 = 200
Write Compression Ratio X 100 = 200
Megabytes transferred to host = 60

Any ideas are welcomed.

James Thompson

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:15 EDT