功能:检查主机磁盘链路,回收磁盘时对磁盘链路进行核对,确认回收无误
#/bin/ksh
#Authorname :wangtao039
#scriptname :chkpath.sh
#Version :v1.0 2016.11.18
#Description:for dmp path check
sudo vxdctl enable
sudo vxdisk -o alldgs list|sort >tmp001
cat tmp001|grep -i dg|awk '{print $1,$4}' >tmp002
cat tmp001|grep invalid|awk '{print $1,$6}' >>tmp002
cat tmp001|grep err|awk '{print $1,$5}' >>tmp002
cat tmp002|grep -v ^disk_|sort>alldgsinfo
sudo vxdmpadm getdmpnode|sort>dmpnodeinfo
join alldgsinfo dmpnodeinfo >joinfile
DISKNUM=`cat joinfile|wc -l`
DISKPATHNUM=`cat joinfile|awk '{sum+=$5}'END'{print sum}'`
DISKOKNUM=`cat joinfile|awk '{if($7==0)print $0}'|wc -l`
DISKABNUM=`cat joinfile|awk '{if($7!=0)print $0}'|wc -l`
PATHDISNUM=`cat joinfile|awk '{if($7!=0)sum+=$7}'END'{print sum}'`
echo DISKNUM DISKPATHNUM DISKOKNUM DISKABNUM PATHDISNUM >/tmp/checkpathfile
echo $DISKNUM $DISKPATHNUM $DISKOKNUM $DISKABNUM $PATHDISNUM >>/tmp/checkpathfile
cat /tmp/checkpathfile|awk '{printf"%-10s%-15s%-15s%-10s%-10s\n",$1,$2,$3,$4,$5}'
echo "-------------------------------------------------------------------------"
cat joinfile|awk '{if($7!=0)print $0}'
rm tmp001 tmp002 alldgsinfo joinfile /tmp/checkpathfile
阅读(2163) | 评论(0) | 转发(0) |