#!/usr/bin/ksh
# The purpose of this script is to find out disk information
# without having to run custom EMC/Hitachi/MPIO commands.
# Generate a list of all disks on this system.
DISKS=`lspv | awk '{ print $1 }'`
for DISK in $DISKS
do
INFO=`lscfg -vl $DISK | grep -e Manufacturer -e "Serial Number" \
-e "Device Specific.(Z1)" | sed 's/\.//g' \
| sed 's/Manufacturer/ /g' | sed 's/Serial Number/ /g' \
| sed 's/Device Specific(Z1)/ /g'`
MAN=`echo $INFO | awk '{ print $1 }'`
SER=`echo $INFO | awk '{ print $2 }'`
DEV=`echo $INFO | awk '{ print $4 }'`
if [ "$INFO" = "" -a "`lscfg -vl $DISK | awk '{ print $3, $4 }'`" = "HDLM Driver" ] ; then
MAN="HDLM"
DEV=`/usr/DynamicLinkManager/bin/dlnkmgr view -path | grep $DISK | head -1 | awk '{ print $6 }'`
fi
if [ "$MAN" = EMC ] ; then
# I only need the third through fifth character of the SER
# variable.
SER=`echo $SER | cut -c 3-5`
echo $DISK $MAN $SER
elif [ "$MAN" = HITACHI ] ; then
echo $DISK $MAN $DEV
elif [ "$MAN" = IBM ] ; then
echo $DISK $MAN Local
elif [ "$MAN" = HDLM ] ; then
echo $DISK $MAN $DEV
else
echo $DISK $MAN -Unknown
fi
done