Every now and again I need to work out mappings between emcpower devices, vxdisk list output and Sun Cluster did devices. Today I got a bit bored with trying to work it out manually again, so I wrote this script.
It could maybe be more elegant but I couldn't work out a way of avoiding using the temporary file. It works, anyway, so here goes;
for i in `vxdisk list | grep emcpower | nawk '{print $1}'`
do
echo
inq 2>/dev/null | grep `inq 2>/dev/null | grep $i | nawk '{print $5}'` > /tmp/inqout
j=`head -1 /tmp/inqout | nawk '{print $1}' | sed 's/\/dev\/rdsk\/c.//' | sed 's/s2//'`
echo VxVM device:
echo $i
echo did device:
scdidadm -L | grep $j
echo EMC devices:
cat /tmp/inqout
rm /tmp/inqout
done
Tuesday, May 12, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment