1
0
mirror of https://github.com/byReqz/stocheck.git synced 2024-09-28 19:43:14 +00:00

(hopefully) fixed lsi controller counting

This commit is contained in:
Nils 2021-02-08 14:03:00 +00:00 committed by GitHub
parent 2e16e52b98
commit f489fb4f91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,16 +155,16 @@ while [ -z "$1" ]; do
echo "-------------------------------------------"
megacli -PDList -aAll | egrep "Enclosure Device ID:|Slot Number:|Inquiry Data:|Error Count:|state"
echo "-------------------------------------------"
for x in {a..z};do
scan=$(smartctl --scan)
if [[ -n $(echo $scan | grep /dev/sd$x) ]];then
echo "------------------- /dev/sd$x --------------------"
smartctl -i -d sat+megaraid,4 /dev/sd$x | grep -e "=== START OF INFORMATION SECTION ===" -e "Device Model:" -e "Serial Number:" -e "Firmware Version:" -e "User Capacity:" -e "SMART support is:" -e "Sector Size:" -e "Rotation Rate:"
for x in {0..32};do
scan=$(megacli -pdlist -a0 | grep "Device Id")
if [[ -n $(echo $scan | grep $x) ]];then
echo "------------------- p$x --------------------"
smartctl -i -d sat+megaraid,$x /dev/sda | grep -e "=== START OF INFORMATION SECTION ===" -e "Device Model:" -e "Serial Number:" -e "Firmware Version:" -e "User Capacity:" -e "SMART support is:" -e "Sector Size:" -e "Rotation Rate:"
echo ""
echo "=== START OF SELF-ASSESSMENT TEST RESULT ==="
smartctl -H -d sat+megaraid,4 /dev/sd$x | grep -e "SMART overall-health self-assessment test result:"
smartctl -H -d sat+megaraid,$x /dev/sda | grep -e "SMART overall-health self-assessment test result:"
echo ""
smartctl -A -d sat+megaraid,4 /dev/sd$x | grep -e "=== START OF READ SMART DATA SECTION ===" -e "SMART overall-health self-assessment test result:" -e "Reallocated_Sector_Ct" -e "Power_On_Hours" -e "Temperature_Celsius" -e "Media_Wearout_Indicator" -e "Power_Cycle_Count" -e "Reported_Uncorrect"
smartctl -A -d sat+megaraid,$x /dev/sda | grep -e "=== START OF READ SMART DATA SECTION ===" -e "SMART overall-health self-assessment test result:" -e "Reallocated_Sector_Ct" -e "Power_On_Hours" -e "Temperature_Celsius" -e "Media_Wearout_Indicator" -e "Power_Cycle_Count" -e "Reported_Uncorrect"
echo "-------------------------------------------------"
else
exit