利用storcli巡检RAID

check-raid.sh
#!/bin/bash
which storcli > /dev/null 2>&1
 
if [[ $? == 0 ]];then
# 检查整体情况
storcli /cALL show all J | jq -r '.Controllers[0]."Response Data" | {"阵列卡":.Basics.Controller, "型号":.Basics.Model, "SN":.Basics."Serial Number", "驱动":.Version."Driver Name", "接口类型":.Bus."Host Interface",  "设备带宽":.Bus."Device Interface", "有无电池":.HwCfg.BBU, "CacheSize":.HwCfg."On Board Memory Size"}, {"阵列卡状态":.Status."Controller Status", "蜂鸣器报警":.HwCfg."Alarm"}, {"硬盘总数":."Physical Drives"}, {"VD数":."Virtual Drives", "VD列表":."VD LIST"[]}'
# RAID状态
storcli /cALL/vALL show J | jq -r '.Controllers[0]."Response Data"."Virtual Drives"[] | {"VD":."DG/VD", "RAID状态":."State"}'
else
	echo "storcli NOT installed..."
fi

  • hardware/lsi/利用storcli巡检raid.txt
  • 最后更改: 2019/04/16 18:31
  • (外部编辑)