dak180 / FreeNAS-Report

SMART & ZPool Status Report for FreeNAS/TrueNAS
GNU General Public License v3.0
44 stars 9 forks source link

Disable NVME smart test reporting #38

Closed scottrus closed 1 week ago

scottrus commented 1 week ago

Looking for a config var that would disable NVME last smart test type and result reporting.

dak180 commented 1 week ago

There currently is no such config variable; what would be your use case?

scottrus commented 1 week ago

With TrueNAS Core, the UI does not allow adding nvd devices to the SMART config. When the report runs because no tests are executing, a red block appears in the report output. By using a variable to show (default) or hide nvme SMART tests, the red cols in the report output should be removed.

dak180 commented 1 week ago

The following is the script that I use to run smart tests on core; it is unlikely at this point you will be able to setup nvme smart test in the gui for core.

#!/bin/bash

while getopts ":t:" OPTION; do
    case "${OPTION}" in
        t)
            testType="${OPTARG}"
        ;;
        ?)
            # If an unknown flag is used (or -?):
            echo "${0} {-t s|l}" >&2
            exit 1
        ;;
    esac
done

readarray -t "drives" <<< "$(sysctl -n kern.disks | sed -e 's:nvd:nvme:g' | tr ' ' '\n' | sort -V | grep 'nvme')"

for drive in "${drives[@]}"; do
    if [ "${testType}" = "s" ]; then
        nvmecontrol selftest -c 0x1 "${drive}"
    elif [ "${testType}" = "l" ]; then
        nvmecontrol selftest -c 0x2 "${drive}"
    fi
done

This script may need to be adjusted if you have any nvme drives that do not support self tests.

JoeSchmuck commented 1 week ago

it is unlikely at this point you will be able to setup nvme smart test in the gui for core.

That is a fact and I would not hold my breath that it will ever come to CORE. SCALE is moving in the correct direction however they are not there yet and I would be surprised if they got it working in the next 6 months. They are waiting on version 7.5 of smartmontools and then they will figure out the script errors they have.