Skip to main content

Module smart

Module smart 

Source
Expand description

SMART health from smartctl JSON files.

Reading SMART data needs root, and rigtop never runs as root nor loosens device permissions. Instead a root systemd timer (see contrib/collect/) runs smartctl -j -a for every drive and writes one JSON file per device into a directory (default /var/lib/rigtop/smart). This module only parses those files.

Files are re-parsed only when their modification time changes, so polling every second costs a stat per drive.

Structs§

SmartReader
Reads and caches SMART result files from a directory.

Functions§

parse_json
Extracts the fields rigtop shows from smartctl -j -a output.