S.M.A.R.T. drive health scanner for macOS and Linux.
All scripts are in scripts/. Run them in sequence or pipe them together:
cd ~/.openclaw/workspace/skills/disk-guardian/scripts
# Full pipeline (may need sudo on Linux):
python3 scan_drives.py | python3 parse_smart.py | python3 report.py
# With sudo (required on many Linux systems):
python3 scan_drives.py --sudo | python3 parse_smart.py | python3 report.py
# Save report to file:
python3 scan_drives.py | python3 parse_smart.py | python3 report.py --output ~/disk-report.md
# Record scan to history and get trend analysis:
python3 scan_drives.py | python3 parse_smart.py | python3 history.py --record
Data is stored in ~/.openclaw/workspace/disk-guardian/ by default. Use --data-dir to override on any script.
scan_drives.py — detects drives and runs smartctl -a on each. Outputs JSON.parse_smart.py — extracts health attributes, assesses status (Good/Warning/Critical).report.py — generates markdown report with risk rankings and recommendations.history.py --record to log the scan and get trend alerts.smartctl must be installed:
brew install smartmontoolssudo apt install smartmontools or sudo dnf install smartmontoolsIf smartctl is missing, scan_drives.py will output the install command and exit gracefully.
diskutil list to find whole disks, then smartctl -a /dev/diskNlsblk to find block devices, then smartctl -a /dev/sdX--sudo: prepend sudo to smartctl commands (needed on Linux without udev rules){os, smartctl_path, drives_found, scan_results: [{device, smartctl_output|error}]}--input FILE: read from file instead of stdin--raw FILE --device NAME: parse a single raw smartctl text dump--record: append current scan to ~/.openclaw/workspace/disk-guardian/history.json--trends: analyze stored history for concerning patterns (rising reallocated sectors, climbing temps, declining NVMe spare)--list [--limit N]: show last N entries per device--data-dir PATH: use alternate storage location--device /dev/diskN: filter output to one device--output FILE: save report to file instead of printing--trends FILE: load pre-computed trend JSONSee references/smart-attributes.md for plain-English explanations of the 10 most critical SMART attributes and NVMe health indicators. Read it when explaining specific attributes to the user or when triaging a flagged drive.
scan_drives.py prints install instructions and exits with code 2--sudo; on Linux, add user to disk group as permanent fixhistory.py backs up the file and starts fresh automatically共 1 个版本