Synology Docker初體驗-Scrutiny Wayne, 2026-03-142026-03-14 因為Synology DSM在7.2以後移除了硬碟S.M.A.R.T. 詳細資訊導致想要看相關資訊變得麻煩最陽春的方法是透過SSH,但是出來的報告很難讀懂又碰巧自己是plus的機種所以決定安裝Scrutiny的docker有圖形介面,要看資訊就方便得多而且之前也沒有架設Docker的經驗,就趁這時候累積經驗值 DSM要先安裝Container套件原本依照之前搜尋到的教學文件,透過倉庫伺服器搜尋到linuxserver/scrutiny映像檔但是在設定的過程中遇到困難無法進行下去決定聽取Gemini的建議,改用「專案 (Project)」功能來安裝安裝這個專案:https://github.com/AnalogJ/scrutiny建立好需要的資料夾結構後,編寫docker-compose.yml version: "3.9" services: scrutiny: image: ghcr.io/analogj/scrutiny:master-omnibus container_name: scrutiny privileged: true environment: - TZ=Asia/Taipei - SCRUTINY_LOG_LEVEL=DEBUG # 這行用來查看詳細錯誤 volumes: - /volume2/docker/Scrutiny/config:/opt/scrutiny/config - /volume2/docker/Scrutiny/influxdb:/opt/scrutiny/influxdb - /run/udev:/run/udev:ro devices: - /dev/sata1:/dev/sata1 - /dev/sata2:/dev/sata2 - /dev/sata3:/dev/sata3 - /dev/sata4:/dev/sata4 ports: - 8080:8080 restart: unless-stopped 第一次沒有安裝成功,看log發現是資料夾權限的問題讓everyone都可以讀寫資料夾之後,總算可以看到Dashboard只不過Dashboard畫面一顆硬碟也沒有,果然沒那麼簡單 docker-compose.yml中設定的自動搜尋硬碟失敗只好在config目錄建立collector.yaml 手動指定掛載路徑 version: 1 devices: - device: /dev/sata1 type: sat - device: /dev/sata2 type: sat - device: /dev/sata3 type: sat - device: /dev/sata4 type: sat 又面臨到錯誤No configuration file found at /opt/scrutiny/config/scrutiny.yaml. Using Defaults.只好多建立一個內容相同的scrutiny.yaml放到config目錄只不過就算讀到設定檔,硬碟依舊沒有出現@@ Omnibus 版本的 Collector(收集器)預設不會在 Web Server 啟動時立刻執行掃描,它通常是靠排程(Cron)或手動觸發利用 Synology 的「任務排程表」直接對容器下指令用root權限執行docker exec scrutiny scrutiny-collector-metrics run總算可以看到硬碟 最後決定在任務排程表中多加匯出文字檔的功能,保留txt的文件資料還加上Telegram通知的功能,才能在第一時間知道硬碟發生狀況 # 這些也是加在DSM的任務排程表中 # 建立匯出資料夾 (如果還不存在) mkdir -p /volume2/docker/Scrutiny/config/reports # 匯出四顆硬碟的完整報告 (加上日期標籤方便辨識) DATE=$(date +%Y%m%d) docker exec scrutiny smartctl -a /dev/sata1 -d sat > /volume2/docker/Scrutiny/config/reports/sata1_${DATE}.txt docker exec scrutiny smartctl -a /dev/sata2 -d sat > /volume2/docker/Scrutiny/config/reports/sata2_${DATE}.txt docker exec scrutiny smartctl -a /dev/sata3 -d sat > /volume2/docker/Scrutiny/config/reports/sata3_${DATE}.txt docker exec scrutiny smartctl -a /dev/sata4 -d sat > /volume2/docker/Scrutiny/config/reports/sata4_${DATE}.txt # (選配) 只保留最近 30 天的報告,避免佔空間 find /volume2/docker/Scrutiny/config/reports/ -name "*.txt" -mtime +30 -delete <<結論>>安裝這個Docker並沒有想像中的簡單要不是有AI協助,找出問題癥結點,真的很難對症下藥接下來還有兩個Docker要安裝,希望可以順利一點 小知識