mirror of
https://github.com/Spearfoot/FreeNAS-scripts
synced 2025-12-10 21:33:20 +00:00
Add Indicator of what field is Warning (#6)
I like to look at my email and in a second see what is wrong! Sometimes I get a Warning or Critical Sign and I have to look at all the table, or open my scrip, to see what parameter is out off bounds. So I added a small char to warn me about what column triggered the error/warning.
This commit is contained in:
@@ -65,11 +65,11 @@ echo "<pre style=\"font-size:14px\">" >> ${logfile}
|
|||||||
(
|
(
|
||||||
echo "########## SMART status report summary for all drives on server ${freenashost} ##########"
|
echo "########## SMART status report summary for all drives on server ${freenashost} ##########"
|
||||||
echo ""
|
echo ""
|
||||||
echo "+------+------------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+----+"
|
echo "+------+------------------+-----+-----+-----+-----+-------+-------+--------+------+---------+------+-------+----+"
|
||||||
echo "|Device|Serial |Temp |Power|Start|Spin |ReAlloc|Current|Offline |Seek |Total |High |Command|Last|"
|
echo "|Device|Serial |Temp |Power|Start|Spin |ReAlloc|Current|Offline |Seek |Total |High |Command|Last|"
|
||||||
echo "| |Number | |On |Stop |Retry|Sectors|Pending|Uncorrec|Errors|Seeks |Fly |Timeout|Test|"
|
echo "| |Number | |On |Stop |Retry|Sectors|Pending|Uncorrec|Errors|Seeks |Fly |Timeout|Test|"
|
||||||
echo "| | | |Hours|Count|Count| |Sectors|Sectors | | |Writes|Count |Age |"
|
echo "| | | |Hours|Count|Count| |Sectors|Sectors | | |Writes|Count |Age |"
|
||||||
echo "+------+------------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+----+"
|
echo "+------+------------------+-----+-----+-----+-----+-------+-------+--------+------+---------+------+-------+----+"
|
||||||
) >> ${logfile}
|
) >> ${logfile}
|
||||||
|
|
||||||
for drive in $drives; do
|
for drive in $drives; do
|
||||||
@@ -103,9 +103,26 @@ for drive in $drives; do
|
|||||||
seekErrors="N/A";
|
seekErrors="N/A";
|
||||||
totalSeeks="N/A";
|
totalSeeks="N/A";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (temp > tempWarn || temp > tempCrit)
|
||||||
|
temp=temp"*"
|
||||||
|
|
||||||
|
if (reAlloc > 0 || reAlloc > sectorsCrit)
|
||||||
|
reAlloc=reAlloc"*"
|
||||||
|
|
||||||
|
if (pending > 0 || pending > sectorsCrit)
|
||||||
|
pending=pending"*"
|
||||||
|
|
||||||
|
if (offlineUnc > 0 || offlineUnc > sectorsCrit)
|
||||||
|
offlineUnc=offlineUnc"*"
|
||||||
|
|
||||||
|
if (testAge > testAgeWarn)
|
||||||
|
testAge=testAge"*"
|
||||||
|
|
||||||
|
|
||||||
if (hiFlyWr == "") hiFlyWr="N/A";
|
if (hiFlyWr == "") hiFlyWr="N/A";
|
||||||
if (cmdTimeout == "") cmdTimeout="N/A";
|
if (cmdTimeout == "") cmdTimeout="N/A";
|
||||||
printf "|%-6s|%-18s| %s |%5s|%5s|%5s|%7s|%7s|%8s|%6s|%10s|%6s|%7s|%4s|\n",
|
printf "|%-6s|%-18s| %s |%5s|%5s|%5s|%7s|%7s|%8s|%6s|%9s|%6s|%7s|%4s|\n",
|
||||||
device, serial, temp, onHours, startStop, spinRetry, reAlloc, pending, offlineUnc,
|
device, serial, temp, onHours, startStop, spinRetry, reAlloc, pending, offlineUnc,
|
||||||
seekErrors, totalSeeks, hiFlyWr, cmdTimeout, testAge;
|
seekErrors, totalSeeks, hiFlyWr, cmdTimeout, testAge;
|
||||||
}'
|
}'
|
||||||
@@ -113,7 +130,7 @@ for drive in $drives; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
(
|
(
|
||||||
echo "+------+------------------+----+-----+-----+-----+-------+-------+--------+------+----------+------+-------+----+"
|
echo "+------+------------------+-----+-----+-----+-----+-------+-------+--------+------+---------+------+-------+----+"
|
||||||
) >> ${logfile}
|
) >> ${logfile}
|
||||||
|
|
||||||
###### for each drive ######
|
###### for each drive ######
|
||||||
|
|||||||
Reference in New Issue
Block a user