0

I have a problem extracting the device names on Solaris 8 SPARC when using 'iostat -En' command since the device names are too long.

For example :

iostat -en output

---- errors ---
s/w h/w trn tot
0 1 0 1 c6t50060E8005BDEC37d124


iostat –En ouput

c6t50060E8005BDESoft Errors: 0 Hard Errors: 1 Transport Errors: 0
Vendor: HP Product: OPEN-V -SUN Revision: 6005 Serial No: 50 0BDEC01D2
Size: 36.20GB <36203397120 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 1 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

When I use iostat -En as you can see c6t50060E8005BDEC37d124 has become c6t50060E8005BDESoft.

How can I format it to be displayed as shown below:

c6t50060E8005BDEC37d124 Soft Errors: 0 Hard Errors: 1 Transport Errors: 0
Vendor: HP Product: OPEN-V -SUN Revision: 6005 Serial No: 50 0BDEC01D2
Size: 36.20GB <36203397120 bytes>

Media Error: 0 Device Not Ready: 0 No Device: 1 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

And I want to use -E option as I need to check for 'Product' value, please don't suggest to use -en

1 Answer 1

1

To get a parseable Product string, you can use kstat -c device_error. To match the result with c*t*d* values, get its node name in /etc/path_to_inst and see what links to it in the /dev/dsk directory.

eg:

# kstat -c device_error
...
module: cmdkerror                       instance: 2     
name:   cmdk2,error                     class:    device_error
        crtime                          51.900857015
        Device Not Ready                0
        Hard Errors                     0
        Illegal Request                 0
        Media Error                     0
        Model                           Maxtor 6Y160M0 
        No Device                       0
        Recoverable                     0
        Revision                        
        Serial No                       Y41Y9W9E       
        Size                            163928604672
        snaptime                        68987.182338653
        Soft Errors                     0
        Transport Errors                0
...
$ grep '2 "cmdk"' /etc/path_to_inst
"/pci@0,0/pci-ide@12/ide@0/cmdk@0,0" 2 "cmdk"
$ ls -l /dev/dsk | grep '/pci@0,0/pci-ide@12/ide@0/cmdk@0,0' | head -1
lrwxrwxrwx   1 root     root          49 Sep 20  2010 c7d0p0 -> ../../devices/pci@0,0/pci-ide@12/ide@0/cmdk@0,0:q

You must log in to answer this question.