Bug 297170 - net-mgmt/smartctl_exporter: device detection is wrong for NVMe (nda(4))
Summary: net-mgmt/smartctl_exporter: device detection is wrong for NVMe (nda(4))
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-07-30 16:42 UTC by Lexi Winter
Modified: 2026-07-31 05:12 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (delphij)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lexi Winter freebsd_committer freebsd_triage 2026-07-30 16:42:28 UTC
the smartctl_exporter rc.d script uses "geom disk status" to determine the available disks.  on a particular system, this prints:

# geom disk status
Name  Status  Components
nda0     N/A  N/A

that causes smartctl_exporter to be started with --smartctl.device=/dev/nda0.  but this doesn't work, because you can't query SMART data from the nda(4) device; instead you have to query the nvme(4) device, /dev/nvme0.

this is simple enough to fix by manually setting smartctl_exporter_devices="/dev/nvme0" in rc.conf, but it would be nice if the script could work it out automatically.

tested with smartctl_exporter-0.14.0_9 on FreeBSD/amd64 15.0.
Comment 1 commit-hook freebsd_committer freebsd_triage 2026-07-31 05:08:19 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=920e8739d6af04c7257ca5dea6ebae15504046ce

commit 920e8739d6af04c7257ca5dea6ebae15504046ce
Author:     Xin LI <delphij@FreeBSD.org>
AuthorDate: 2026-07-31 04:54:08 +0000
Commit:     Xin LI <delphij@FreeBSD.org>
CommitDate: 2026-07-31 05:06:48 +0000

    net-mgmt/smartctl_exporter: fix NVMe device discovery in rc.d script

    Switch from a fixed device list (via geom disk status) to smartctl_exporter's
    built-in auto-discovery with periodic rescan.  The old approach had two issues:
    nda(4) devices can't be queried for SMART data (the nvme(4) controller must be
    used instead), and a fixed list doesn't detect hot-plugged devices.

    Add smartctl_exporter_device_exclude defaulting to "nda" to filter NVMe CAM
    devices from auto-discovery.  Users can still override with
    smartctl_exporter_devices in rc.conf for an explicit device list.

    PR:             297170
    Reported by:    ivy

 net-mgmt/smartctl_exporter/files/smartctl_exporter.in | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)