dak180 / FreeNAS-Report

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

SAS Drive Wear Leveling Count Issue (v1.8.1) #30

Closed SrTisch closed 9 months ago

SrTisch commented 9 months ago

Ran into an issue where Wear Leveling Count showed ((100 - 8)) instead of 92. Found the issue to be from this section of the script (1862-1869)

local wearLeveling
    if [ "${rpm:-"0"}" = "0" ]; then
        local percentUsed="$(jq -Mre '.scsi_percentage_used_endurance_indicator | values' <<< "${sasInfoSmrt}")"
        if [ ! -z "${percentUsed}" ]; then
            wearLeveling="((100 - ${percentUsed:-0}))"
        fi
        rpm="SSD "
    fi

Changed line 1866 to the following and that seemed to fix it. wearLeveling=$((100 - ${percentUsed:-0}))

Thanks for all of your work!