Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- megacli -pdlist -aALL
- Firmware state: Offline
- devices=( $(smartctl --scan | grep megaraid | awk '{print $3}') ); drives=( $(smartctl --scan | grep "/dev/sd" | awk '{print $1}') ); for ((i=0; i < ${#devices[@]}; ++i)); do serial=$(smartctl -a -d ${devices[$i]} ${drives[$i]} | grep -i "serial number:" | awk '{print $NF}'); result=$(smartctl -H -d ${devices[$i]} ${drives[$i]} | grep "SMART" | grep -v "===" | awk '{print $NF}'); echo -n "${drives[$i]} Serial: $serial SMART: $result"; j=$(echo ${drives[$i]} | cut -d/ -f3); echo -n " Errors: ";grep -i error /var/log/kern.log | grep "$j," | wc -l; done
- ~$ devices=( $(smartctl --scan | grep megaraid | awk '{print $3}') ); drives=( $(smartctl --scan | grep "/dev/sd" | awk '{print $1}') ); for ((i=0; i < ${#devices[@]}; ++i)); do serial=$(smartctl -a -d ${devices[$i]} ${drives[$i]} | grep -i "serial number:" | awk '{print $NF}'); result=$(smartctl -H -d ${devices[$i]} ${drives[$i]} | grep "SMART" | grep -v "===" | awk '{print $NF}'); echo -n "${drives[$i]} Serial: $serial SMART: $result"; j=$(echo ${drives[$i]} | cut -d/ -f3); echo -n " Errors: ";grep -i error /var/log/kern.log | grep "$j," | wc -l; done
- /dev/sda Serial: S0N20VQ9 SMART: OK Errors: 0
- /dev/sdb Serial: WMC1F2102143 SMART: OK Errors: 0
- /dev/sdc Serial: WMC1F2054975 SMART: OK Errors: 0
- /dev/sdd Serial: WMC1F2099834 SMART: OK Errors: 30
- /dev/sde Serial: WMC1F0D7UTXY SMART: OK Errors: 0
- /dev/sdf Serial: WMC1F2031170 SMART: OK Errors: 0
- /dev/sdg Serial: WMC1F2016664 SMART: OK Errors: 0
- /dev/sdh Serial: WMC1F1758680 SMART: OK Errors: 0
- /dev/sdi Serial: WMC1F1824839 SMART: OK Errors: 0
Add Comment
Please, Sign In to add comment