@@ -88,11 +88,11 @@ if [ $SATA_count -gt 0 ]; then
88
88
(
89
89
echo " ########## SMART status report summary for all SATA drives on server ${freenashost} ##########"
90
90
echo " "
91
- echo " +------+------------------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+----+"
92
- echo " |Device|Serial |Temp|Power|Start|Spin |ReAlloc|Current|Offline |Seek |Total |High |Command|Last|"
93
- echo " | |Number | |On |Stop |Retry|Sectors|Pending|Uncorrec|Errors|Seeks |Fly |Timeout|Test|"
94
- echo " | | | |Hours|Count|Count| |Sectors|Sectors | | |Writes|Count |Age |"
95
- echo " +------+------------------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+----+"
91
+ echo " +------+------------------------+----+------ +-----+-----+-------+-------+--------+------+----------+------+---- -------+----+"
92
+ echo " |Device|Serial |Temp| Power|Start|Spin |ReAlloc|Current|Offline |Seek |Total |High | Command|Last|"
93
+ echo " | |Number | | On |Stop |Retry|Sectors|Pending|Uncorrec|Errors|Seeks |Fly | Timeout|Test|"
94
+ echo " | | | | Hours|Count|Count| |Sectors|Sectors | | |Writes| Count |Age |"
95
+ echo " +------+------------------------+----+------ +-----+-----+-------+-------+--------+------+----------+------+---- -------+----+"
96
96
) >> " $logfile "
97
97
98
98
# ##### Detail information for each SATA drive ######
@@ -128,29 +128,21 @@ if [ $SATA_count -gt 0 ]; then
128
128
seekErrors="N/A";
129
129
totalSeeks="N/A";
130
130
}
131
-
132
131
if (temp > tempWarn || temp > tempCrit) temp=temp"*"
133
-
134
132
if (reAlloc > 0 || reAlloc > sectorsCrit) reAlloc=reAlloc"*"
135
-
136
133
if (pending > 0 || pending > sectorsCrit) pending=pending"*"
137
-
138
134
if (offlineUnc > 0 || offlineUnc > sectorsCrit) offlineUnc=offlineUnc"*"
139
-
140
135
if (testAge > testAgeWarn) testAge=testAge"*"
141
-
142
136
if (hiFlyWr == "") hiFlyWr="N/A";
143
-
144
137
if (cmdTimeout == "") cmdTimeout="N/A";
145
-
146
- printf "|%-6s|%-24s|%-4s|%5s|%5s|%5s|%7s|%7s|%8s|%6s|%10s|%6s|%7s|%4s|\n",
138
+ printf "|%-6s|%-24s|%-4s|%6s|%5s|%5s|%7s|%7s|%8s|%6s|%10s|%6s|%11s|%4s|\n",
147
139
device, serial, temp, onHours, startStop, spinRetry, reAlloc, pending, offlineUnc,
148
140
seekErrors, totalSeeks, hiFlyWr, cmdTimeout, testAge;
149
141
}'
150
142
) >> " $logfile "
151
143
done
152
144
(
153
- echo " +------+------------------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+----+"
145
+ echo " +------+------------------------+----+------ +-----+-----+-------+-------+--------+------+----------+------+---- -------+----+"
154
146
) >> " $logfile "
155
147
fi
156
148
@@ -206,14 +198,25 @@ if [ $SATA_count -gt 0 ] || [ $SAS_count -gt 0 ]; then
206
198
207
199
# ##### Emit SATA drive information ######
208
200
for drive in $SATA_list ; do
209
- brand=$( " $smartctl " -i " $drive " | grep " Model Family" | awk ' {print $3, $4, $5, $6, $7}' )
210
- if [ -z " $brand " ]; then
211
- brand=$( " $smartctl " -i " $drive " | grep " Device Model" | awk ' {print $3, $4, $5, $6, $7}' )
201
+ vendor=$( " $smartctl " -i " $drive " | grep " Vendor:" | awk ' {print $NF}' )
202
+ if [ -z " $vendor " ]; then
203
+ dfamily=$( " $smartctl " -i " $drive " | grep " Model Family" | awk ' {print $3, $4, $5, $6, $7}' | sed -e ' s/[[:space:]]*$//' )
204
+ dmodel=$( " $smartctl " -i " $drive " | grep " Device Model" | awk ' {print $3, $4, $5, $6, $7}' | sed -e ' s/[[:space:]]*$//' )
205
+ if [ -z " $dfamily " ]; then
206
+ dinfo=$dmodel
207
+ else
208
+ dinfo=" $dfamily ($dmodel )"
209
+ fi
210
+ else
211
+ product=$( " $smartctl " -i " $drive " | grep " Product:" | awk ' {print $NF}' )
212
+ revision=$( " $smartctl " -i " $drive " | grep " Revision:" | awk ' {print $NF}' )
213
+ dinfo=" $vendor $product $revision "
212
214
fi
213
215
serial=$( " $smartctl " -i " $drive " | grep " Serial Number" | awk ' {print $3}' )
214
216
(
215
217
echo " "
216
- echo " ########## SMART status for SATA drive $drive $serial (${brand} ) ##########"
218
+ echo " ########## SATA drive $drive Serial: $serial "
219
+ echo " ########## ${dinfo} "
217
220
" $smartctl " -n never -H -A -l error " $drive "
218
221
" $smartctl " -n never -l selftest " $drive " | grep " # 1 \\ |Num" | cut -c6-
219
222
) >> " $logfile "
0 commit comments