The --discover command probes every drive on your system, tests whether SMART data is readable, detects protocol mismatches, and offers to write the correct config for you. It's the fastest way to get SMART Sniffer working on NAS devices and non-standard hardware.
Run --discover when:
- You just installed the agent on a NAS (Synology, QNAP, TrueNAS) and want to confirm your drives are detected
- Drives show as UNSUPPORTED in Home Assistant
- You added or replaced a drive and want the agent to pick it up
- You're not sure if your hardware needs
device_overrides
You don't need --discover on standard Linux, macOS, or Windows machines with SATA or NVMe drives. Those are detected automatically by smartctl --scan and work out of the box.
sudo smartha-agent --discoverThe agent must already be installed. --discover uses the same smartctl binary the agent uses at runtime, so if the agent works, discovery works.
Discovery runs in three phases:
Runs smartctl --scan-open (or --scan as fallback) to find all drives the OS knows about. For each drive, it tests whether SMART data is readable using the reported protocol.
If the system is detected as Synology (via /etc/synoinfo.conf or the presence of /dev/sata1), discovery also probes the proprietary /dev/sata1 through /dev/sata8 paths that smartctl --scan doesn't find on its own.
QNAP is detected via /etc/config/qpkg.conf or /sbin/get_hd_smartinfo. On QNAP, the agent notes that SAT fallback is handled automatically at runtime.
For any drive where the initial protocol (usually SCSI) fails to return SMART data, discovery automatically retries with SAT (SCSI-to-ATA Translation). NAS devices commonly report SATA drives as SCSI through their HBA controllers -- SAT is the fix.
SMART Sniffer -- Drive Discovery
Scanning drives...
/dev/sda
Protocol: ATA
SMART data: Yes
Model: Samsung SSD 870 EVO 1TB
Serial: S1234567890
Result: OK
/dev/nvme0
Protocol: NVMe
SMART data: Yes
Model: WD Black SN770 500GB
Serial: W1234567890
Result: OK
Found 2 drive(s). 2 readable.
No config changes needed.
SMART Sniffer -- Drive Discovery
Scanning drives...
Standard scan found 0 drives.
Detected Synology platform. Probing /dev/sata paths...
/dev/sata1
Scan protocol: sat
SMART data: Yes
Model: WD Red Plus 4TB
Serial: WD-WCC7K1234567
Result: Needs device_override (not found by standard scan)
/dev/sata2
Scan protocol: sat
SMART data: Yes
Model: WD Red Plus 4TB
Serial: WD-WCC7K7654321
Result: Needs device_override (not found by standard scan)
/dev/sata3 -- not present
/dev/sata4 -- not present
Found 2 drive(s). 2 readable.
2 drive(s) need device_overrides in your config.
Proposed additions to config.yaml:
device_overrides:
- device: /dev/sata1
protocol: sat
- device: /dev/sata2
protocol: sat
Write to /etc/smart-sniffer/config.yaml? [Y/n]:
SMART Sniffer -- Drive Discovery
Scanning drives...
/dev/sda
Scan protocol: SCSI
SMART data: No
SAT retry: Yes -- SMART data available
Model: Seagate IronWolf 8TB
Serial: ZA1234567
Result: OK (agent will auto-detect SAT at runtime)
Detected QNAP platform.
Found 1 drive(s). 1 readable.
No config changes needed -- the agent handles protocol detection automatically.
When drives need device_overrides, discovery shows you exactly what it will write and asks for confirmation. It only adds a device_overrides section -- it never modifies your existing config fields (port, scan_interval, token, etc.).
Before writing, it automatically backs up your config to config.yaml.bak.
Example addition:
device_overrides:
- device: /dev/sata1
protocol: sat
- device: /dev/sata2
protocol: satAfter writing, restart the agent to apply:
sudo systemctl restart smart-snifferTo see what discovery would find without modifying your config:
sudo smartha-agent --discover --no-writeThis runs the full scan and shows the proposed config changes but skips the write step.
You can re-run --discover at any time. Common reasons:
- Added a new drive -- re-run to detect it and add its override
- Replaced a drive -- the new drive may have a different path or protocol
- Drives show as UNSUPPORTED after an update -- re-run to re-test protocol detection
Important: --discover appends device_overrides to your config. If you run it multiple times, you may end up with duplicate entries. Check your config.yaml after re-running and remove any duplicates.
Discovery handles protocol detection and Synology/QNAP platform quirks. It doesn't help with:
- Virtual disks in VMs -- virtual disk controllers don't pass SMART commands regardless of protocol. See the Virtual Machines guide or the Proxmox guide.
- Hardware RAID controllers -- if your drives sit behind a hardware RAID controller (MegaRAID, Adaptec, etc.),
smartctlneeds a RAID-specific device type (-d megaraid,0). Discovery doesn't probe RAID controllers yet. See the RAID Controllers guide for controller identification and config examples. - USB-attached drives -- some USB enclosures don't pass SMART commands. Try
-d satmanually withsmartctlto test.
If you later reinstall the agent and choose "N" at the "Keep current settings?" prompt, the installer rewrites config.yaml from scratch. This will erase your device_overrides. The installer does not currently preserve custom config sections during reconfigure.
To avoid losing your overrides:
- Choose "Y" (keep current settings) during reinstall if you only need to update the agent binary
- Back up your
config.yamlbefore reinstalling - Re-run
--discoverafter reinstalling if you chose "N"
You don't have to use --discover. You can write device_overrides by hand in config.yaml:
device_overrides:
- device: /dev/sata1
protocol: sat
- device: /dev/sata2
protocol: sat
- device: /dev/sdb
protocol: scsiEach entry needs:
device-- the block device path (e.g.,/dev/sata1,/dev/sda)protocol-- the smartctl device type (sat,scsi,nvme,ata, or a RAID type likemegaraid,0)
Discovery is just the automated way to generate these entries. The result is the same either way.
- Synology guide --
/dev/sataXpaths and SynoCli smartmontools - QNAP guide -- SCSI-to-SAT protocol detection
- TrueNAS SCALE guide -- ZFS and filesystem monitoring
- Platform Install Paths -- where the agent and config live on each platform
