Skip to content

Feature Request: Automated scan support for kernel-bypass devices (SPDK, vfio-pci) #392

Open

Description

@anurag-bug

Summary

smartctl_exporter cannot automatically discover and monitor NVMe devices accessed via kernel-bypass drivers such as SPDK (/dev/spdk/nvme*) and vfio-pci. These devices require an explicit -d nvme type flag to be passed to smartctl, but the current auto-scan (smartctl --scan) does not enumerate them since they are not exposed through the standard kernel block layer.

Current Behavior

smartctl --scan only discovers devices visible to the kernel (e.g. /dev/nvme*, /dev/sd*). Devices bound to vfio-pci or managed by SPDK are inaccessible through this path.

The --smartctl.device-include regexp flag also cannot help here — it filters devices found by scan, but SPDK/vfio-pci devices are never surfaced by scan in the first place.

The only current workaround is manually enumerating each device with --smartctl.device:

--smartctl.device=/dev/spdk/nvme0;nvme
--smartctl.device=/dev/spdk/nvme1;nvme

This is operationally painful on hosts with many drives, doesn't support rescan on hotplug.

Proposed Solution

Add a new repetable flag --smartctl.device-extra-scan or --smartctl.extra-device that accepts a regex pattern paired with an explicit device type:

--smartctl.extra-device='/dev/spdk;^nvme\d+$;nvme'
--smartctl.extra-device='/dev/vfio;^[0-9]+$;nvme'

Format: <directory>;<name-regex>;<device-type>

The exporter would match the devices with regex at startup and on each rescan interval, apply the existing --smartctl.device-include / --smartctl.device-exclude filters, and add matched devices with the specified type. This keeps the feature generic — any future kernel-bypass path works without further code changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions