edgarsuit / FreeNAS-Report

SMART & ZPool Status Report for FreeNAS
GNU General Public License v3.0
113 stars 45 forks source link

No SMART Details from Disks #12

Closed drmany closed 4 years ago

drmany commented 4 years ago

The SMART list is empty, when i manually read the SMART details from the FreeNAS shell it gives me a normal output with SMART Parameters. I´m running FreeNAS 11.3 U1. If i choose the option to list the SMART parameters of my M.2 drives when i get a normal output in the mail.

image

m-rm commented 4 years ago

Did you enable includeSSD in the script?

drmany commented 4 years ago

Jap, i enabled that before, because we have the system of two m.2 drives in Raid1. Then i enable "includeSSD" the two m.2 shows up, but all other hard drives are not listet. In the example aboth the option "includeSSD" is disabled.

drmany commented 4 years ago

Can it be a naming issue in the script? Because the hard drives have a different name sheme as the m.2 ssd´s?

m-rm commented 4 years ago

Hm, maybe. Does sysctl -n kern.disks list the drives?

Also check with smartctl -i /dev/DRIVE (replace DRIVE with the actual name) if it says SMART support is: Enabled.

If that's ok then it may be a parsing issue.

drmany commented 4 years ago

So sysctl -n kern.disk showes me all my drives included the two system drives (m.2). smartctl -i /dev/mydrive told me that SMART support is enabled....

m-rm commented 4 years ago

Then it's probably a problem parsing the smartctl output with awk. Unfortunately I don't know awk well enough to be any help.

edgarsuit commented 4 years ago

What's the output of smartctl -A -i for one of your disks?

drmany commented 4 years ago

I found the problem. It´s an issue with the if [ "$(smartctl -i /dev/"${drive}" | grep "SMART support is: Enabled")" ]; then

The problem is the Space in between "SMART support is:" and the "Enable", its a string that is not variable in length. It must be egrep "SMART support is:[ \t]+Enabled. Because its depent on the disks or raid-controller that is in use. You may have diffrent outputs on SMART, the problem is the format of the SMART output and thats the next problem, the m.2 drives have a completly different SMART output than my hard-drives. Now my hard-drives can be read by the script but the script can´t put the informations from SMART output in the table because of the different format from the SMART for my hdds. This explains why the script works with the m.2 ssd.

edgarsuit commented 4 years ago

Got it, that makes sense. Can you send me an example output of smartctl -A -i for one of you drives so I can work on an update that fixes this issue?

drmany commented 4 years ago

Sure, here it is.

The thirst one is the HDD output, the second is the SSD. You think it´s a lot of work?

HDDSMART SSDSMART

drmany commented 4 years ago

Do you think its alot of work? because i need a this script for my work and been searching for a while to find a functionaly script.

edgarsuit commented 4 years ago

Your HDDs are SAS disks, the script isn't intended for use with SAS disks. There's a SAS version of the plaintext-only script here: https://www.ixsystems.com/community/threads/scripts-to-report-smart-zpool-and-ups-status-hdd-cpu-t%C2%B0-hdd-identification-and-backup-the-config.27365/

drmany commented 4 years ago

okay, but is it possible to import the SAS-version or an option to choose into this script? Iwant to have one script for the SMART and ZPool and i like the table of this script you can realize fas if a drive fails.

edgarsuit commented 4 years ago

Yeah, you can have the data represented in the smartctl output for SAS disks in an emailed table but that's not work I'm going to be able to undertake. Feel free to fork the script and give it a go yourself, it's only a few hundred lines of code.