Display additionnal device info in detail
This commit is contained in:
parent
8a3c0de8e4
commit
beee18371c
|
@ -102,7 +102,7 @@ if test -s /tmp/dscan; then
|
|||
## If no correct type was found for this device
|
||||
if [ -z "${TYPE}" ]; then
|
||||
[ "${debug}" -eq "0" ] && printf "${c_magentab}%-6b${c_reset}\n" "DEBUG : SMART is not fully supported."
|
||||
DRES=$(printf '%s' "${SMART_SUPPORT_MSG}")
|
||||
DRES=$(printf '%s' "SMART Health Status can't be determine because of:\n${SMART_SUPPORT_MSG}")
|
||||
DCODE="2"
|
||||
TYPE="unsupported"
|
||||
else
|
||||
|
@ -110,6 +110,8 @@ if test -s /tmp/dscan; then
|
|||
### Get SMART Health Status and return code
|
||||
DRES=$(/usr/sbin/smartctl -H -d "${TYPE}" -n standby "${DISK}")
|
||||
DCODE=$?
|
||||
DID=$(smartctl -i -d "${TYPE}" "${DISK}" | awk '/.erial .umber:/ { print $NF }')
|
||||
DINFO=$(smartctl -i -d "${TYPE}" "${DISK}" | grep -v -E "^smartctl|^Copyright|^$")
|
||||
fi
|
||||
|
||||
## Test health status
|
||||
|
@ -131,6 +133,8 @@ if test -s /tmp/dscan; then
|
|||
COLOR="3&green"
|
||||
fi
|
||||
|
||||
## Avoid duplicate device
|
||||
if ! grep -q "${DID}" /tmp/dres; then
|
||||
## For summary
|
||||
echo "${COLOR} $DISK ${TYPE}"
|
||||
|
||||
|
@ -139,10 +143,12 @@ if test -s /tmp/dscan; then
|
|||
echo "${COLOR} $DISK ${TYPE}" | cut -c2-
|
||||
echo ""
|
||||
echo "$DRES" | grep -v -E "^smartctl|^Copyright|^$|^==="
|
||||
echo "${DINFO}"
|
||||
echo "------------------------------------------------------------"
|
||||
echo ""
|
||||
echo ""
|
||||
} >> /tmp/dres
|
||||
fi
|
||||
done < /tmp/dscan >> /tmp/dcheck
|
||||
|
||||
# If the file is empty
|
||||
|
|
Loading…
Reference in New Issue