獲取在oracleasmlib上hds儲存的多路徑

zhangsharp20發表於2017-02-14
#!/bin/bash
oracleasm listdisks > /tmp/1.txt
var2=`oracleasm listdisks |wc -l`
> /tmp/2.txt
> /tmp/3.txt
for ((i=1;i<=var2;i++))
do
 var1=`cat /tmp/1.txt|sed -n ${i}p`
 oracleasm querydisk -p $var1 |grep emc|cut -d ':' -f 1|cut -b 6-|sed 's/1//g' >>/tmp/3.txt
 oracleasm querydisk -p $var1 |sed '1,2d'|wc -l >>/tmp/3.txt
done
oracleasm listdisks |awk '{print "oracleasm querydisk -p "$0"| grep emc|cut -d '\'':'\'' -f 1|cut -b 6-|sed 's/1//g' >>/tmp/2.txt"}' >/tmp/1.sh
sh /tmp/1.sh
powermt display dev=all| grep emc |cut -d '=' -f 2 >/tmp/4.txt
echo "###############unused emc/hds storages###############"
grep -F -v -f /tmp/3.txt /tmp/4.txt |sort|uniq
echo "###############path counts#######################"
grep -F -v -f /tmp/4.txt /tmp/3.txt |sort|uniq


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29802484/viewspace-2133514/,如需轉載,請註明出處,否則將追究法律責任。

相關文章