bmc_pwd="Huawei12#$"
echo "Start collecting storage info... please wait..."
echo "" > /usr/tmp/$1
date >> /usr/tmp/$1
echo "----------Query FusionStorage version info start-----" >> /usr/tmp/$1
/opt/dsware/vbs/bin/dsware_vbs -v |grep version >> /usr/tmp/$1
echo "----------Query FusionStorage version info end-----" >> /usr/tmp/$1

echo "----------Query FusionStorage NVME SSD disk start-----" >> /usr/tmp/$1
cat spc_storages.txt | while read storage;do ssh -n root@${storage} cat /proc/smio_host |grep nvme >> /usr/tmp/$1;done
echo "----------Query FusionStorage NVME SSD disk end-----" >> /usr/tmp/$1

echo "----------Query FusionStorage StoragePool Info start-----">> /usr/tmp/$1
/opt/dsware/agent/tool/dsware_insight 2 203 129.175.102.8 10901 14 425 0 >> /usr/tmp/$1
/opt/dsware/agent/tool/dsware_insight 2 203 129.175.102.8 10901 14 425 1 >> /usr/tmp/$1
/opt/dsware/agent/tool/dsware_insight 2 203 129.175.102.8 10901 14 425 2 >> /usr/tmp/$1
echo "----------Query FusionStorage StoragePool Info end-----">> /usr/tmp/$1

echo "----------Query FusionStorage Pool 0 StorageLUN Info start-----">> /usr/tmp/$1
/opt/dsware/agent/tool/dsware_insight 2 203 129.175.102.8 10901 14 420 0 >> /usr/tmp/$1
echo "----------Query FusionStorage Pool 0 StorageLUN Info end-----">> /usr/tmp/$1

echo "----------Query FusionStorage Pool 1 StorageLUN Info start-----">> /usr/tmp/$1
/opt/dsware/agent/tool/dsware_insight 2 203 129.175.102.8 10901 14 420 1 >> /usr/tmp/$1
echo "----------Query FusionStorage Pool 1 StorageLUN Info end-----">> /usr/tmp/$1

echo "----------Query FusionStorage Pool 2 StorageLUN Info start-----">> /usr/tmp/$1
/opt/dsware/agent/tool/dsware_insight 2 203 129.175.102.8 10901 14 420 2 >> /usr/tmp/$1
echo "----------Query FusionStorage Pool 2 StorageLUN Info end-----">> /usr/tmp/$1

echo "----------Query FusionStorage StorageNode Power Supply Info start-----">> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.24 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.22 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.21 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.101 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.102 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.103 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.104 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.105 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.106 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.107 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.108 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.111 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.112 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.113 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.114 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.115 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.116 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.117 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.118 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.131 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.132 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.133 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.134 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.135 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.136 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.137 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.138 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.139 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.141 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.142 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.143 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.144 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.145 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.146 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.147 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.148 -U root -P ${bmc_pwd} sensor |grep Power >> /usr/tmp/$1      

echo "----------Query FusionStorage StorageNode Power Supply Info end-----">> /usr/tmp/$1

echo "----------Query FusionStorage StorageNode FAN Info start-----">> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.101 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.102 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.103 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.104 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.105 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.106 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.107 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.108 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.111 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.112 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.113 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.114 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.115 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.116 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.117 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.118 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.131 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.132 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.133 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.134 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.135 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.136 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.137 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.138 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.139 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.141 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.142 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.143 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.144 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.145 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.146 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.147 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.148 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.21 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.22 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
ipmitool -I lanplus -H 100.175.100.24 -U root -P ${bmc_pwd} sensor |grep FAN >> /usr/tmp/$1
echo "----------Query FusionStorage StorageNode FAN Info end-----">> /usr/tmp/$1


echo "----------Query Hosts Info start-----">> /usr/tmp/$1
/opt/dsware/agent/tool/dsware_insight 0 22 129.175.102.131 10530 8 110 |grep -e PORT -e 10901 >> /usr/tmp/$1
echo "----------Query Hosts Info end-----">> /usr/tmp/$1

echo "----------Query Hosts Logical Volume Info start-----">> /usr/tmp/$1
lvdisplay >> /usr/tmp/$1
echo "----------Query Hosts Logical Volume Info end-----">> /usr/tmp/$1
date >> /usr/tmp/$1


