Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solaris 10 iostat -En only shows instance names 1

Status
Not open for further replies.

marrow

Technical User
Jul 20, 2001
425
0
0
US
iostat -En on Solaris9 would display disk in descriptive mode cXtYdZ but this appears not to work in S10. I am trying to equate an ssd to an actual disk. Any ideas please as to why this no longer works?
 
I wrote this script to automate the otherwise tedious procedure of getting that information:

Code:
#!/bin/ksh
#
# Determine which disk is ssdnn

ME=$(basename $0)

if [ -z "$1" ]
then
        echo "$ME: usage: $ME <disknumber>"
else
        DEVICEPATH=$(nawk -v DISKNUMBER=$1 -v SEARCHSTRING="$ME" 'BEGIN {FS="[ \"]+"} $4 == SEARCHSTRING && $3 == DISKNUMBER {print $2}' /etc/path_to_inst)

        if [ -z "$DEVICEPATH" ]
        then
                echo "$ME: No matching devices found in /etc/path_to_inst."
                exit
        fi

        echo "$ME: DEVICEPATH is $DEVICEPATH"
        echo

        ls -l /dev/dsk/*s2 | fgrep "${DEVICEPATH}:c" | nawk '{print $9}' | while read DEVICE
        do
                DEVICEFOUND=true
                echo "$ME: DEVICE is $DEVICE"

                if [ -x /usr/sbin/vxdisk ]
                then
                        echo
                        if [ "$LOGNAME" = "root" ]
                        then
                                vxdisk list $(basename $DEVICE)
                        else
                                echo "$ME: Not logged in as root; unable to run vxdisk list on device."
                        fi
                fi
        done

        if [ -z "$DEVICEFOUND" ]
        then
                echo "$ME: No devices found using device path ${DEVICEPATH}."
                exit
        fi

fi

The script should be saved as, say, devinfo, and then symbolic links created ssd -> devinfo, sd -> devinfo, etc. Then you can just type ssd NN and it will return the info about that device number.

Annihilannic.
 
Thanks Annih. I will try this later this week
 
Very useful script AnniH

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top