From e0d74b52472d15ae07b389d614656f772ae6f100 Mon Sep 17 00:00:00 2001 From: Nils <32552517+byReqz@users.noreply.github.com> Date: Tue, 2 Feb 2021 12:38:45 +0000 Subject: [PATCH] added better smart filter currently only for non raid drive --- stocheck.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stocheck.sh b/stocheck.sh index 0990946..13d5e0a 100644 --- a/stocheck.sh +++ b/stocheck.sh @@ -17,7 +17,9 @@ while [ -z "$1" ]; do scan=$(smartctl --scan) if [[ -n $(echo $scan | grep /dev/sd$x) ]];then echo "------------------- /dev/sd$x --------------------" - smartctl -H -i /dev/sd$x; + smartctl -i /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:" + echo "" + smartctl -A /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" echo "-------------------------------------------------" else exit @@ -33,7 +35,9 @@ while [ -z "$1" ]; do scan=$(smartctl --scan) if [[ -n $(echo $scan | grep /dev/nvme$x) ]];then echo "------------------- /dev/nvme$x --------------------" - smartctl -H -i /dev/nvme$x; + smartctl -i /dev/nvme$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:" + echo "" + smartctl -A /dev/nvme$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" echo "---------------------------------------------------" fi done