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
mkdir -p /opt/scrutiny/{influxdb,config} && cd /opt/scrutinynano docker-compose.ymlversion: '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: 10sStart Scrutiny
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:8080to access the Scrutiny web interface
PVE Collection
Run the following on the PVE node:
cd /opt/scrutinynano scrutiny-collector-install.shReplace 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_DIRcurl -L $LATEST_RELEASE_URL -o $BIN_DIR/scrutiny-collector-metrics-linux-amd64chmod +x $BIN_DIR/scrutiny-collector-metrics-linux-amd64
mkdir -p /root/scrutinycat << 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.logEOFchmod +x /root/scrutiny/scrutiny.sh
cat << 'EOF' > /etc/systemd/system/scrutiny.service[Unit]Description=Scrutiny CollectorRequires=scrutiny.timer
[Service]Type=simpleExecStart=/root/scrutiny/scrutiny.shUser=rootEOF
cat << 'EOF' > /etc/systemd/system/scrutiny.timer[Unit]Description=Timer for the scrutiny.service
[Timer]Unit=scrutiny.serviceOnBootSec=5minOnUnitActiveSec=60min
[Install]WantedBy=timers.targetEOF
systemctl enable scrutiny.timersystemctl start scrutiny.timersystemctl status scrutiny.timerRun the Script
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