1) Install Entware
Enable SSH on QNAP, then:
wget -O - http://bin.entware.net/x64-k3.2/installer/generic.sh | sh
Verify and fix PATH (usually already correct):
export PATH=/opt/bin:/opt/sbin:$PATH
2) Install smartmontools (Entware)
/opt/bin/opkg update
/opt/bin/opkg install smartmontools
Verify:
/opt/sbin/smartctl --version
3) Download Scrutiny collector binary
mkdir -p /opt/scrutiny/bin
cd /opt/scrutiny/bin
curl -L \
https://github.com/AnalogJ/scrutiny/releases/latest/download/scrutiny-collector-metrics-linux-amd64 \
-o scrutiny-collector-metrics-linux-amd64
chmod +x scrutiny-collector-metrics-linux-amd64
4) Detect disk types (important on QNAP)
/opt/sbin/smartctl --scan
Then confirm ATA passthrough works:
/opt/sbin/smartctl -a -d sat /dev/sda
If this shows full SMART data → use type: sat.
5) Create collector config
mkdir -p /share/CE_CACHEDEV1_DATA/scrutiny
vi /share/CE_CACHEDEV1_DATA/scrutiny/collector.yaml
version: 1
host:
id: "QNAP-NAS (172.16.20.9)"
api:
endpoint: "http://172.16.20.35:505"
commands:
metrics_smartctl_bin: /opt/sbin/smartctl
devices:
- device: /dev/sda
type: sat
- device: /dev/sdb
type: sat
- device: /dev/sdc
type: sat
- device: /dev/sdd
type: sat
6) Test collector manually
/opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 \
run \
--config /share/CE_CACHEDEV1_DATA/scrutiny/collector.yaml \
--debug
Confirm:
-d satis usedexit_status: 0- metrics appear in remote Scrutiny UI server
7) Schedule via cron (QNAP way)
vi /etc/config/crontab
Example (hourly):
0 * * * * PATH=/opt/sbin:/opt/bin:/bin:/usr/bin /opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 run --config /share/CE_CACHEDEV1_DATA/scrutiny/collector.yaml >> /share/CE_CACHEDEV1_DATA/scrutiny/collector.log 2>&1
8) Ensure cron survives reboot (recommended)
vi /etc/config/autorun.sh
#!/bin/sh
crontab /etc/config/crontab
chmod +x /etc/config/autorun.sh
crontab /etc/config/crontab
/etc/init.d/crond.sh restart
9) Post-reboot check
crontab -l
tail -n 20 /share/CE_CACHEDEV1_DATA/scrutiny/collector.log