SmartAttribute class

class diskinfo.SmartAttribute(_id, attribute_name, flag, value, worst, thresh, _type, updated, when_failed, raw_value)[source]

This class implements a SMART attribute. It stores ten values from smartctl command.

Example

This class presents one line in the following sample output (from a`smartctrl` command):

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   095   095   000    Old_age   Always       -       23268
 12 Power_Cycle_Count       0x0032   092   092   000    Old_age   Always       -       7103
177 Wear_Leveling_Count     0x0013   099   099   000    Pre-fail  Always       -       20
179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0
181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0
182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0
183 Runtime_Bad_Block       0x0013   100   099   010    Pre-fail  Always       -       0
187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0032   072   045   000    Old_age   Always       -       28
195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0
199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0
235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       218
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       51650461687
Parameters:
  • _id (int) –

  • attribute_name (str) –

  • flag (int) –

  • value (int) –

  • worst (int) –

  • thresh (int) –

  • _type (str) –

  • updated (str) –

  • when_failed (str) –

  • raw_value (int) –

attribute_name: str

Name of the SMART attribute.

flag: int

SMART attribute handling flag.

id: int

ID of the SMART attribute (1-255).

raw_value: int

The raw value for the SMART attribute, defined by the manufacturer.

thresh: int

Lowest value (defined by manufacturer) that worst is allowed to reach for a SMART attribute.

type: str

Type of the SMART attribute:

  • Pre-fail: the attribute is considered a critical one

  • Old_age: the attribute does not fail the disk

updated: str

Indicator when the SMART attribute is updated (values are Always or Offline).

value: int

Normalized value of SMART attribute (0-255). Notes:

  • values 0, 254, 255 are reserved for internal use

  • value 253 means not used yet

  • many cases it is starting at value=100 case then dropping to value=1

when_failed: str

Usually it is blank, or it contains the last operational hour when this SMART attribute failed.

worst: int

Lowest value of the SMART attribute.