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