SMART-Werte auslesen und interpretieren

@framp
You can send emails via a script using DSM's ssmtp. Though it's not a simple one line of code (more like 68 lines if you want to make it bullet-proof). You could strip it down to about 13 lines if you removed all the checking.

The script needs to create a txt file that contains the to and from email addresses, subject and the body of the email.

Have a look at the function in https://github.com/007revad/Linux_Plex_Backup/blob/develop/Linux_Plex_Backup.sh from line 175 to 234.

NOTE: Change msmtp to ssmtp for DSM.

Add the following near the top of the script:
Code:
to_email_address=you@gmail.com
from_email_address=you@gmail.com
email_directory=/tmp

Then you'd need to add the following later in the script where you want to send to the email:
Code:
    # Send log via email if both logging and emails are enabled
    if [[ $to_email_address && $from_email_address ]]; then
        echo -e "\nSending email..."
        email_contents="email_contents.txt"
        send_email "$to_email_address" "$from_email_address" "$email_directory"  "$email_contents" "$script log"
    fi
 
  • Like
Reaktionen: framp und maxblank
I threw SMART values of my disks at ChatGPT and I got a very nice and detailed analysis report.

I think I don't have to reinvent the wheel again. I'm sure there exist already OSS SMART value analysis tools for Linux. I only have to find them 🧐
 
  • Haha
Reaktionen: ctrlaltdelete
  • Like
Reaktionen: AndiHeitzer
I didn't know about your script 😠. Will test it right now. Should work because I use WD disks.
 
Works perfect (y)
Everything is OK according you script output.

ChatGPT warned me the power on time is beyond the usual lifetime of a disk when it's running for > 5 years. I got also other warning about the disk spin update time from ChatGPT which seems to be a valid warning.
 
ChatGPT is often misleading, or even completely wrong.

For NAS and server drives the power on time would normally be "24 x 365 x the number years the drive has been in the NAS or server". So it's impossible for a drive to have "the power on time is beyond the usual lifetime of a disk when it's running for > 5 years".

Spin up time is just the "number of times you've rebooted the NAS x how long it takes the drive to spin up".

The SMART attributes to monitor, according to BackBlaze, are:

AttributeDescription
SMART 5Reallocated Sectors Count
SMART 187Reported Uncorrectable Errors
SMART 188Command Timeout
SMART 197Current Pending Sector Count
SMART 198Uncorrectable Sector Count
 
  • Like
Reaktionen: framp und dil88
I'm sorry but I don't get your point :(
Was "the power on time is beyond the usual lifetime of a disk when it's running for > 5 years" exactly what ChatGPT wrote? Or was that how you phrased it?

That sentence is confusing (to me). I understood "the power on time is beyond the usual lifetime of a disk when it's running for > 5 years" to be saying the drive has been running for more hours than a drive > 5 years should have.

If it was ChatGPT why didn't it just say "the disk is has been running for more than 5 years and drives usually die after being powered on for 5 years".
 
I got you now 🙂 . It's the wording but finally it's nevertheless a hint the disk is active for more than 5 years when disks may start to degrade.

Spin up time is just the "number of times you've rebooted the NAS x how long it takes the drive to spin up".
Are you sure? I'm just in the beginning to learn about the semantic of the SMART values - but for me the worst value is the worst spin up time and if it's increasing this gives me an indication the drive motor starts to degrade.

But as far as I understand right now - you get a lot of SMART values but it's quite difficult to identify drives which may fail in a given time frame from these values.
 
Spin up time is just the "number of times you've rebooted the NAS x how long it takes the drive to spin up".
I was wrong again. It happens sometimes :(

According to Acronis:
Spin-Up Time S.M.A.R.T. parameter indicates an average time (in milliseconds or seconds) of spindle spinup (from zero RPM (Revolutions Per Minute) to fully operational).

The low value means it takes too long for the hard disk to a fully operational state.

This parameter is considered informational by the most hardware vendors. Although degradation of this parameter can be an indicator of drive aging and/or potential electromechanical problems, it does not directly indicate imminent drive failure. Regular backup is recommended. Pay closer attention to other parameters and overall drive health.
 
  • Love
Reaktionen: dil88
Hallo-Ich habe das jetzt mal bei meiner DS224+ mit 2 Synology HAT3300-6T ausprobiert-die ja Seagate Platten sind.

Mit diesem Befehl als root auf der Konsole erhalte ich eine Ausgabe mit mit den bekannten hohen Zahlenwert.
smartctl -iA -d sat /dev/sata1

Code:
root@XXXXXXXX:~# smartctl -iA -d sat /dev/sata1
smartctl 6.5 (build date Sep 26 2022) [x86_64-linux-4.4.302+] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     HAT3300
Device Model:     Synology HAT3300-6T
Serial Number:    XXXXXXXX
LU WWN Device Id: 5 000c50 0e9286191
Firmware Version: PL01
User Capacity:    6,001,175,126,016 bytes [6.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      3.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-3 T13/2161-D revision 5
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Thu Apr 10 22:59:34 2025 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME                                                   FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Error_Rate                                                   0x000f   083   064   006    Pre-fail  Always       -       183702669
  3 Spin_Up_Time                                                     0x0003   091   091   000    Pre-fail  Always       -       0
  4 Start/Stop_Count                                                 0x0032   100   100   020    Old_age   Always       -       129
  5 Reallocated_Sector_Ct                                            0x0033   100   100   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate                                                  0x000f   081   060   045    Pre-fail  Always       -       127118856
  9 Power_On_Hours                                                   0x0032   099   099   000    Old_age   Always       -       1663
 10 Spin_Retry_Count                                                 0x0013   100   100   097    Pre-fail  Always       -       0
 12 Drive_Power_Cycle_Count                                          0x0032   100   100   020    Old_age   Always       -       121
183 PHY_Counter_Events                                               0x0032   100   100   000    Old_age   Always       -       0
184 Reported_IOEDC_Errors                                            0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrectables                                          0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeouts                                                 0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes                                                  0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature                                              0x0022   071   068   040    Old_age   Always       -       29 (Min/Max 18/31)
191 Shock_Count                                                      0x0032   100   100   000    Old_age   Always       -       0
192 Emergency_Retract_Count                                          0x0032   100   100   000    Old_age   Always       -       49
193 Load/Unload_Count                                                0x0032   100   100   000    Old_age   Always       -       357
194 Temperature                                                      0x0022   029   040   000    Old_age   Always       -       29 (0 11 0 0 0)
195 ECC_On_the_Fly_Count                                             0x001a   083   064   000    Old_age   Always       -       183702669
197 Current_Pending_Sector                                           0x0012   100   100   000    Old_age   Always       -       0
198 Uncorrectable_Sectors_Count                                      0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count                                             0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flight_Hours                                                0x0000   100   253   000    Old_age   Offline      -       108606838015581
241 Lifetime_Writes_From_host                                        0x0000   100   253   000    Old_age   Offline      -       12418115725
242 Lifetime_Reads_From_Host                                         0x0000   100   253   000    Old_age   Offline      -       13872260588

root@XXXXXXXX:~#

Soweit ok-wenn ich jedoch als root eingebe um gleich die umgerechneten Werte zu sehen
"smartctl -iA -v 1,raw48:54 -v 7,raw48:54 -v 195,raw48:54 /dev/sata1"
erhalte ich jedoch dieses

Code:
root@XXXXXXXXXX:~# smartctl -iA -v 1,raw48:54 -v 7,raw48:54 -v 195,raw48:54 /dev/sata1
smartctl 6.5 (build date Sep 26 2022) [x86_64-linux-4.4.302+] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               Synology
Product:              HAT3300-6T
Revision:             PL01
User Capacity:        6,001,175,126,016 bytes [6.00 TB]
Logical block size:   512 bytes
Physical block size:  4096 bytes
LU is fully provisioned
Rotation Rate:        5400 rpm
Form Factor:          3.5 inches
Logical Unit id:      0x5000c500e9286191
Serial number:        XXXXXXXX
Device type:          disk
Local Time is:        Thu Apr 10 22:30:56 2025 CEST
SMART support is:     Unavailable - device lacks SMART capability.

=== START OF READ SMART DATA SECTION ===
root@XXXXXXXXX:~#

Hat hier Synology was an deren Firmware "verbockt" das eben dieses Ergebnis kommt?
" device lacks SMART capability"
Gerät ist nicht SMART-fähig?????
Danke für Eure Rückmeldung.
 
Zuletzt bearbeitet:
Danke für Deine Information@DaveR
Ich habe die SynoCli Disk Tools installiert und mit dem Befehl

Code:
smartctl7 -iA -d sat -v 1,raw48:54 -v 7,raw48:54 -v 195,raw48:54 /dev/sata1

funktioniert das jetz!
 
  • Like
Reaktionen: DaveR

Additional post fields

 

Kaffeautomat

Wenn du das Forum hilfreich findest oder uns unterstützen möchtest, dann gib uns doch einfach einen Kaffee aus.

Als Dankeschön schalten wir deinen Account werbefrei.

:coffee:

Hier gehts zum Kaffeeautomat