317 字
2 分钟

Monitoring Disk Health with Scrutiny in a Proxmox VE Environment

Preface#

In a previous post, I introduced how to deploy Scrutiny with Docker to monitor your hard drives. Now we’ll further refine and improve the deployment process.

Why Scrutiny#

Scrutiny is a Docker-based disk health monitoring tool. It collects disk information via SMART (Self-Monitoring, Analysis and Reporting Technology) data and presents trends, alerts, and other metrics through a web interface.

Key advantages include:

  • Supports multiple drive types (HDD, SSD, NVMe)
  • Visual dashboards with trend charts for temperature, health status, read/write errors, and more
  • Supports InfluxDB as time-series storage for long-term monitoring
  • Can integrate with other systems via API

Deployment#

Install Scrutiny#

Terminal window
mkdir -p /opt/scrutiny/{influxdb,config} && cd /opt/scrutiny
nano docker-compose.yml
version: '2.4'
services:
scrutiny-influxdb:
image: influxdb:2.2
container_name: scrutiny-influxdb
ports:
- 8086:8086
restart: unless-stopped
volumes:
- ./influxdb:/var/lib/influxdb2
environment:
TZ: Asia/Kolkata # CHANGE THIS
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8086/health"]
interval: 5s
timeout: 10s
retries: 20
scrutiny-web:
image: 'ghcr.io/analogj/scrutiny:master-web'
container_name: scrutiny-web
ports:
- 8080:8080
restart: unless-stopped
volumes:
- ./config:/opt/scrutiny/config
environment:
SCRUTINY_WEB_INFLUXDB_HOST: scrutiny-influxdb
TZ: Asia/Kolkata # CHANGE THIS
depends_on:
scrutiny-influxdb:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
interval: 5s
timeout: 10s
retries: 20
start_period: 10s

Start Scrutiny#

Terminal window
docker-compose up -d
  • The Scrutiny web service runs on port 8080 by default
  • InfluxDB runs on port 8086 by default
  • You can open a browser and visit http://your-server-ip:8080 to access the Scrutiny web interface

PVE Collection#

Run the following on the PVE node:

Terminal window
cd /opt/scrutiny
nano scrutiny-collector-install.sh

Replace API_ENDPOINT with the IP address of your Scrutiny container.

#!/bin/bash
API_ENDPOINT="http://192.168.XX.XX:8080"
apt install smartmontools -y
INSTALL_DIR="/opt/scrutiny"
BIN_DIR="$INSTALL_DIR/bin"
LATEST_RELEASE_URL=$(curl -s https://api.github.com/repos/AnalogJ/scrutiny/releases/latest | grep "browser_download_url.*scrutiny-collector-metrics-linux-amd64" | cut -d '"' -f 4)
mkdir -p $BIN_DIR
curl -L $LATEST_RELEASE_URL -o $BIN_DIR/scrutiny-collector-metrics-linux-amd64
chmod +x $BIN_DIR/scrutiny-collector-metrics-linux-amd64
mkdir -p /root/scrutiny
cat << EOF > /root/scrutiny/scrutiny.sh
#!/bin/bash
/opt/scrutiny/bin/scrutiny-collector-metrics-linux-amd64 run --api-endpoint "$API_ENDPOINT" 2>&1 | tee /var/log/scrutiny.log
EOF
chmod +x /root/scrutiny/scrutiny.sh
cat << 'EOF' > /etc/systemd/system/scrutiny.service
[Unit]
Description=Scrutiny Collector
Requires=scrutiny.timer
[Service]
Type=simple
ExecStart=/root/scrutiny/scrutiny.sh
User=root
EOF
cat << 'EOF' > /etc/systemd/system/scrutiny.timer
[Unit]
Description=Timer for the scrutiny.service
[Timer]
Unit=scrutiny.service
OnBootSec=5min
OnUnitActiveSec=60min
[Install]
WantedBy=timers.target
EOF
systemctl enable scrutiny.timer
systemctl start scrutiny.timer
systemctl status scrutiny.timer

Run the Script#

Terminal window
chmod +x scrutiny-collector-install.sh
./scrutiny-collector-install.sh
Monitoring Disk Health with Scrutiny in a Proxmox VE Environment
https://catcat.blog/en/how-to-install-scrunity-on-proxmox.html
作者
猫猫博客
发布于
2025-10-05
许可协议
CC BY-NC-SA 4.0