Skip to main content

Nvme Health

@aaronge/nvme-healthv2026.11.05.1· MIT· 16d agoBEHAVIORSWORKFLOWSACCEPTED WARNINGS
01README

NVMe drive health for any Linux host: SMART/health log (critical warnings, spare, wear, media errors, unsafe shutdowns, thermal throttling) with per-reading deltas, hwmon temperatures, controller identity and the error log, as a typed, versioned Swamp behavior with scheduled workflow assertions.

02Release Notes

First release: NVMe SMART/health log with per-reading deltas, hwmon temperatures, identity and error log, plus @aaronge/nvme-health (15-minute health asserts) and @aaronge/nvme-inventory (daily) workflows.

03Behaviors1
@aaronge/nvme-healthv2026.11.05.1nvme_health.ts

Global Arguments

ArgumentTypeDescription
device?stringNVMe controller character device, e.g. /dev/nvme0 (not a namespace
nvmePath?stringPath to the nvme-cli binary.
useSudo?booleanRun nvme through `sudo -n` for the root-only admin commands
sudoPath?stringPath to the sudo binary.
sysfsNvmePath?stringsysfs directory holding the nvmeN controller entries.
fn readSmart()
Read the health log (`nvme smart-log`, root), decode critical warnings, and record deltas against the previous reading.
fn readTemperature()
Read every temperature the drive exposes through hwmon. Needs no privileges.
fn readIdentity()
Read model, serial, firmware and link details from sysfs, plus capacity, temperature thresholds and power/self-test capabilities from `nvme id-ctrl` (root; those fields are null when it can't run).
fn readErrorLog()
Read the controller's error-information log (`nvme error-log`, root) and keep the non-empty entries.

Resources

smart(infinite)— Health log: critical warnings, spare, wear, lifetime counters, and deltas since the previous reading.
temperature(infinite)— hwmon temperatures (no root needed).
identity(infinite)— Controller identity from sysfs plus capabilities from id-ctrl.
errorLog(infinite)— Non-empty entries from the controller's error log.
04Workflows2
@aaronge/nvme-healthce2287d2-c707-4f48-aaf9-56a749928540

Read the NVMe health log and hwmon temperatures from nvme-local and assert the drive is healthy: no critical warning, spare above its threshold plus a margin, wear below maxPercentUsed, composite temperature below tempWarnCelsius, and no NEW media errors, error-log entries or over-temperature minutes since the previous reading. New unsafe shutdowns are reported but don't fail the run: they point at power loss, not at the drive. Every 15 minutes, since wear, spare and error counters move slowly a

collectRead the health log and hwmon temperatures.
1.readSmartnvme-local.readSmart
2.readTemperaturenvme-local.readTemperature
assertFail the run when the drive reports a health problem.
1.no-critical-warning
2.spare-above-threshold
3.wear-below-limit
4.no-new-media-errors
5.no-new-error-log-entries
6.temperature-ok
7.write-rate-ok
8.no-new-unsafe-shutdowns
reportPrint a one-screen summary. Depends on collect only (not assert), so it still runs when an assertion fails.
1.summarize
@aaronge/nvme-inventorye8a0cb34-30e4-4cc3-9ca4-ae12b1f19259

Daily NVMe inventory from nvme-local: controller identity (model, serial, firmware, link, capacity, temperature thresholds, power-state and self-test support) and the controller's error log. Separate from the 15-minute @aaronge/nvme-health check because none of this changes minute to minute. Asserts the controller is live and the error log is empty.

collectRead identity and the error log.
1.readIdentitynvme-local.readIdentity
2.readErrorLognvme-local.readErrorLog
assertFail the run when the controller isn't live or has logged errors.
1.controller-live
2.error-log-empty
reportPrint a one-screen summary, whatever the asserts decided.
1.summarize
05Stats
A
100 / 100
Downloads
2
Archive size
19.0 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned

07Platforms
08Labels