diff --git a/sysutils/smart/Makefile b/sysutils/smart/Makefile index 111cc3115..8a0c576f2 100644 --- a/sysutils/smart/Makefile +++ b/sysutils/smart/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= smart PLUGIN_VERSION= 2.2 -PLUGIN_REVISION= 2 +PLUGIN_REVISION= 3 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 73a2f6567..d8a3b55c1 100755 --- a/sysutils/smart/src/opnsense/scripts/OPNsense/Smart/detailed_list.sh +++ b/sysutils/smart/src/opnsense/scripts/OPNsense/Smart/detailed_list.sh @@ -27,15 +27,21 @@ RESULT= -for DEV in $(smartctl --scan | awk '{ print $1 }'); do +for DEV in $(sysctl -n kern.disks); do IDENT=$(/usr/sbin/diskinfo -s ${DEV}) - STATE=$(/usr/local/sbin/smartctl -jH ${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}) if [ -n "${RESULT}" ]; then RESULT="${RESULT},"; fi - RESULT="${RESULT}{\"device\":\"${DEV##/dev/}\",\"ident\":\"${IDENT}\",\"state\":${STATE}}"; + RESULT="${RESULT}{\"device\":\"${DEV}\",\"ident\":\"${IDENT}\",\"state\":${STATE}}"; done echo "[${RESULT}]"