Skip to content

Nordikk/smartpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SMART Summary Helper

smart.py is a small CLI that summarizes SMART data across disks. It uses smartctl (JSON) and, when needed, supplements missing values with Seagate’s OpenSeaChest (openSeaChest_SMART). Mount points and driver hints are configurable via smartpy.env.

Requirements

  • Python 3
  • smartmontools (smartctl on PATH)
  • Optional: OpenSeaChest (openSeaChest_SMART on PATH or set via SEACHEST_BIN)

Configuration (smartpy.env)

Example is included. Supported keys:

  • MOUNT_SDA=/mnt/disks/movies – mount points per base device; multiple separated by commas
  • DRIVER_SDA=sat,scsi – smartctl driver order per base device; if set, only this order is tried (no automatic fallback)
  • SEACHEST_BIN=openSeaChest_SMART – path/binary name for SeaChest

Mount hints apply to the base device (e.g., MOUNT_SDA covers /dev/sda1). If no entry exists, /etc/fstab is scanned for /dev/... lines (UUID/LABEL are ignored).

Usage

  • Auto-discover (sd?, nvme?, mmcblk?):
    python3 smart.py
  • Explicit devices:
    python3 smart.py /dev/sda /dev/sdb

Output per disk includes model, mount points, chosen smartctl driver, and protocol. Key lines:

  • Health / Assessment
  • Temperature, Power-On-Hours (with y/m/d/h breakdown)
  • Reallocated / Pending / Offline-Uncorrectable
  • Reasons (shown on warnings/errors or when fallbacks were used)

Behavior

  • smartctl: Uses JSON (-H -A -j). Driver from DRIVER_* or default order (auto, sat, scsi).
  • SeaChest: Invoked when essential fields are missing. Supplemented values/errors are noted under “Reasons”. Device is called with --device <path> --smartAttributes.
  • USB/SCSI devices often hide attributes; the script calls this out explicitly.

Tips

  • For many USB Seagate enclosures: set DRIVER_SDI=sat and SEACHEST_BIN=openSeaChest_SMART in smartpy.env.
  • To experiment with drivers, set a comma-separated order (e.g., DRIVER_SDI=sat,scsi).

About

Python-based CLI tool for checking SMART-values and summarize it - human-readable!

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages