Skip to content
Discussion options

You must be logged in to vote

Short answer: Yes, privileged: true + -v /dev:/dev:ro is the right approach for your use case.

How it works under the hood:

The collector always runs smartctl --scan automatically on each collection run — no collector.yaml configuration is needed for standard disks. The issue is purely whether the container can see the /dev nodes in the first place.

Option A — Explicit device list (default, more secure):

devices:
  - "/dev/sda"
  - "/dev/sdb"
  # ... repeat for all 20+
cap_add:
  - SYS_RAWIO
  - SYS_ADMIN  # required for NVMe
volumes:
  - /run/udev:/run/udev:ro

smartctl --scan runs inside the container and only sees what you explicitly passed in. Secure, but you have to update the list wh…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Starosdev
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants