# NVMe SMART health — notify when any monitored field changes. # Needs smartmontools (in preinstall PACKAGES) + passwordless sudo for # smartctl. Set it up once: # echo '%sudo ALL=(ALL) NOPASSWD: /usr/sbin/smartctl' | sudo tee /etc/sudoers.d/smartctl # Adjust /dev/nvme0n1 if your disk has a different device name. # Note: 'temperature' drifts, so onchange will fire most hours — drop the # temperature alternative from the grep if you only want fault-field alerts. INTERVAL=hourly NOTIFY=onchange MSG=NVMe health COMMAND=sudo -n smartctl -a /dev/nvme0n1 | grep -Ei 'critical_warning|temperature|available_spare|percentage_used|media_errors|error_information'