From 71bdd6c136ebb0255386b891545d10b028ffd6ce Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 1 Oct 2011 10:55:27 +0000 Subject: [PATCH] grep smart logs for failure and running smart tests git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@280 191e9f34-6774-4a6d-acfc-7664dacd4a2a --- recepies/smart/failure.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 recepies/smart/failure.sh diff --git a/recepies/smart/failure.sh b/recepies/smart/failure.sh new file mode 100755 index 0000000..dbd9c6e --- /dev/null +++ b/recepies/smart/failure.sh @@ -0,0 +1,5 @@ +sed='s!/smart.! !' +egrep '(Raw_Read_Error_Rate|Reallocated_Sector_Ct|Seek_Error_Rate|Spin_Retry_Count|Reallocated_Event_Count|Current_Pending_Sector|Offline_Uncorrectable|UDMA_CRC_Error_Count)' */smart.* | awk '{ if ( $10 > 0 ) print $1 " " $2 " " $10 }' | sed -e "$sed" -e 's/:[0-9][0-9]* / /' | sort | while read host serial status count ; do + echo $host $serial $status $count + egrep -A 1 '(failure|progress)' $host/smart.*$serial | sed -e "$sed" +done -- 2.20.1