diff --git a/sysutils/smart/Makefile b/sysutils/smart/Makefile index b0863f9fb..111cc3115 100644 --- a/sysutils/smart/Makefile +++ b/sysutils/smart/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= smart PLUGIN_VERSION= 2.2 -PLUGIN_REVISION= 1 +PLUGIN_REVISION= 2 PLUGIN_COMMENT= SMART tools PLUGIN_DEPENDS= smartmontools PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/sysutils/smart/src/opnsense/scripts/OPNsense/Smart/detailed_list.sh b/sysutils/smart/src/opnsense/scripts/OPNsense/Smart/detailed_list.sh index d8a3b55c1..73a2f6567 100755 --- a/sysutils/smart/src/opnsense/scripts/OPNsense/Smart/detailed_list.sh +++ b/sysutils/smart/src/opnsense/scripts/OPNsense/Smart/detailed_list.sh @@ -27,21 +27,15 @@ RESULT= -for DEV in $(sysctl -n kern.disks); do +for DEV in $(smartctl --scan | awk '{ print $1 }'); do IDENT=$(/usr/sbin/diskinfo -s ${DEV}) - - if [ "${DEV#nvd}" != "${DEV}" ]; then - # the disk formerly know as nvdX - DEV="nvme${DEV#nvd}" - fi - - STATE=$(/usr/local/sbin/smartctl -jH /dev/${DEV}) + STATE=$(/usr/local/sbin/smartctl -jH ${DEV}) if [ -n "${RESULT}" ]; then RESULT="${RESULT},"; fi - RESULT="${RESULT}{\"device\":\"${DEV}\",\"ident\":\"${IDENT}\",\"state\":${STATE}}"; + RESULT="${RESULT}{\"device\":\"${DEV##/dev/}\",\"ident\":\"${IDENT}\",\"state\":${STATE}}"; done echo "[${RESULT}]"