diff --git a/xymon/plugins/client/ext/smart b/xymon/plugins/client/ext/smart index ddcbf30..4e416eb 100755 --- a/xymon/plugins/client/ext/smart +++ b/xymon/plugins/client/ext/smart @@ -113,8 +113,11 @@ if test -s /tmp/dscan; then ### Get SMART Health Status and return code DRES=$(/usr/sbin/smartctl -H -d "${TYPE}" -n standby "${DISK}") DCODE=$? + ### Get disk's serial number and informations DID=$(smartctl -i -d "${TYPE}" "${DISK}" | awk '/.erial .umber:/ { print $NF }') DINFO=$(smartctl -i -d "${TYPE}" "${DISK}" | grep -v -E "^smartctl|^Copyright|^$") + ### Check if the disk is known from smartmontools database + DDRIVEDB=$(smartctl -d "${TYPE}" -P show "${DISK}") fi ## Test health status @@ -136,6 +139,15 @@ if test -s /tmp/dscan; then COLOR="3&green" fi + ## If the model of the disk is known from smartmontools database + if "${DDRIVEDB}" | grep -qi -- "drive found in"; then + DDRIVEDB_MSG="&green Device is known in smartmontools database. You might consider using a more advanced plugin such as: + https://github.com/skazi0/xymon-plugins/blob/master/client/ext/smart" + else + DDRIVEDB_MSG="&clear Device is unknown or not complete in smartmontools database. Please take a look to the FAQ: +https://www.smartmontools.org/wiki/FAQ#SmartmontoolsDatabase" + fi + ## Avoid duplicate device if ! grep -q "${DID}" /tmp/dres; then ## For summary @@ -146,6 +158,7 @@ if test -s /tmp/dscan; then echo "${COLOR} $DISK ${TYPE}" | cut -c2- echo "" echo "$DRES" | grep -v -E "^smartctl|^Copyright|^$|^===" + echo "${DDRIVEDB_MSG}" echo "${DINFO}" echo "------------------------------------------------------------" echo ""