Skip to main content

Scrutiny Setup Guide

Scrutiny is a hard drive health monitoring tool that tracks SMART metrics and provides a web dashboard. This guide covers both the host/server setup and collector configuration.


Setup Scrutiny Host (Web Server)

The Scrutiny host consists of three services: InfluxDB (database), the web UI, and an optional collector for the host machine itself.

Deploy the Stack

  1. Create the directory structure and set ownership:

    sudo mkdir -p /opt/docker/scrutiny
    sudo chown -R $USER:$USER /opt/docker
    cd /opt/docker/scrutiny
  2. Create the docker-compose.yml file with the following configuration:

    name: scrutiny

    services:
    influxdb:
    restart: unless-stopped
    image: influxdb:2.2
    ports:
    - '8089:8086'
    volumes:
    - './influxdb:/var/lib/influxdb2'
    healthcheck:
    test: ["CMD", "curl", "-f", "http://localhost:8086/health"]
    interval: 5s
    timeout: 10s
    retries: 20


    web:
    restart: unless-stopped
    image: 'ghcr.io/analogj/scrutiny:master-web'
    ports:
    - '8091:8080'
    volumes:
    - './config:/opt/scrutiny/config'
    environment:
    SCRUTINY_WEB_INFLUXDB_HOST: 'influxdb'
    depends_on:
    influxdb:
    condition: service_healthy
    healthcheck:
    test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
    interval: 5s
    timeout: 10s
    retries: 20
    start_period: 10s

    collector:
    restart: unless-stopped
    image: 'ghcr.io/analogj/scrutiny:master-collector'
    cap_add:
    - SYS_RAWIO
    - SYS_ADMIN
    volumes:
    - '/run/udev:/run/udev:ro'
    environment:
    COLLECTOR_API_ENDPOINT: 'http://web:8080'
    COLLECTOR_HOST_ID: 'Ubuntu Media Server'
    # If true forces the collector to run on startup (cron will be started after the collector completes)
    # see: https://github.com/AnalogJ/scrutiny/blob/master/docs/TROUBLESHOOTING_DEVICE_COLLECTOR.md#collector-trigger-on-startup
    COLLECTOR_RUN_STARTUP: true
    depends_on:
    web:
    condition: service_healthy
    devices:
    - "/dev/nvme0"
    - "/dev/nvme1"
    - "/dev/sde"
    - "/dev/sdg"
    - "/dev/sdf"
    - "/dev/sdd"
    - "/dev/sdb"
    - "/dev/sda"
    - "/dev/sdc"
  3. Start the services:

    docker compose up -d
  4. Access the web interface at http://<server-ip>:8091

Configuration Notes

  • InfluxDB: Exposed on port 8089 (mapped from 8086) for direct access if needed
  • Web UI: Accessible on port 8091 (mapped from 8080)
  • Collector: The built-in collector runs on the same host as the Docker containers
    • Update the COLLECTOR_HOST_ID to identify your host server
    • Add or remove device mappings under devices: section based on your drives
    • The collector automatically runs on startup and then on a cron schedule

Device Discovery

To find your device names on Linux:

lsblk
# or
ls -la /dev/sd* /dev/nvme*

Add each drive you want to monitor to the devices: section in the collector service.


Configure SMTP Notifications

Scrutiny can send email notifications when drive issues are detected. This requires configuring SMTP settings in the Scrutiny configuration file.

Setup Steps

  1. Navigate to the Scrutiny config directory:

    cd /opt/docker/scrutiny/config
  2. Create a scrutiny.yaml file with the following content:

    # Commented Scrutiny Configuration File
    #
    # The default location for this file is /opt/scrutiny/config/scrutiny.yaml.
    # In some cases to improve clarity default values are specified,
    # uncommented. Other example values are commented out.
    #
    # When this file is parsed by Scrutiny, all configuration file keys are
    # lowercased automatically. As such, Configuration keys are case-insensitive,
    # and should be lowercase in this file to be consistent with usage.


    ######################################################################
    # Version
    #
    # version specifies the version of this configuration file schema, not
    # the scrutiny binary. There is only 1 version available at the moment
    version: 1

    # web:
    # listen:
    # port: 8080
    # host: 0.0.0.0

    # if you're using a reverse proxy like apache/nginx, you can override this value to serve scrutiny on a subpath.
    # eg. http://example.com/scrutiny/* vs http://example.com:8080
    # see docs/TROUBLESHOOTING_REVERSE_PROXY.md
    # basepath: `/scrutiny`
    # leave empty unless behind a path prefixed proxy
    # basepath: ''
    # database:
    # can also set absolute path here
    # location: /opt/scrutiny/config/scrutiny.db
    # src:
    # the location on the filesystem where scrutiny javascript + css is located
    # frontend:
    # path: /opt/scrutiny/web

    # if you're running influxdb on a different host (or using a cloud-provider) you'll need to update the host & port below.
    # token, org, bucket are unnecessary for a new InfluxDB installation, as Scrutiny will automatically run the InfluxDB setup,
    # and store the information in the config file. If you 're re-using an existing influxdb installation, you'll need to provide
    # the `token`
    # influxdb:
    # scheme: 'http'
    # host: 0.0.0.0
    # port: 8086
    # token: 'my-token'
    # org: 'my-org'
    # bucket: 'bucket'
    # retention_policy: true
    # if you wish to disable TLS certificate verification,
    # when using self-signed certificates for example,
    # then uncomment the lines below and set `insecure_skip_verify: true`
    # tls:
    # insecure_skip_verify: false

    log:
    file: '' #absolute or relative paths allowed, eg. web.log
    level: INFO


    # Notification "urls" look like the following. For more information about service specific configuration see
    # Shoutrrr's documentation: https://containrrr.dev/shoutrrr/services/overview/
    #
    # note, usernames and passwords containing special characters will need to be urlencoded.
    # if your username is: "[email protected]" and your password is "124@34$1"
    # your shoutrrr url will look like: "smtp://myname%40example%2Ecom:124%4034%[email protected]:587"

    notify:
    urls:
    # - "discord://token@webhookid"
    # - "telegram://token@telegram?channels=channel-1[,channel-2,...]"
    # - "pushover://shoutrrr:apiToken@userKey/?priority=1&devices=device1[,device2, ...]"
    # - "slack://[botname@]token-a/token-b/token-c"
    - "smtp://username:password@host:port/?fromAddress=fromAddress&toAddresses=recipient1[,recipient2,...]"
    # - "teams://token-a/token-b/token-c"
    # - "gotify://gotify-host/token"
    # - "pushbullet://api-token[/device/#channel/email]"
    # - "ifttt://key/?events=event1[,event2,...]&value1=value1&value2=value2&value3=value3"
    # - "mattermost://[username@]mattermost-host/token[/channel]"
    # - "ntfy://username:password@host:port/topic"
    # - "hangouts://chat.googleapis.com/v1/spaces/FOO/messages?key=bar&token=baz"
    # - "zulip://bot-mail:bot-key@zulip-domain/?stream=name-or-id&topic=name"
    # - "join://shoutrrr:api-key@join/?devices=device1[,device2, ...][&icon=icon][&title=title]"
    # - "script:///file/path/on/disk"
    # - "https://www.example.com/path"

    ########################################################################################################################
    # FEATURES COMING SOON
    #
    # The following commented out sections are a preview of additional configuration options that will be available soon.
    #
    ########################################################################################################################

    #limits:
    # ata:
    # critical:
    # error: 10
    # standard:
    # error: 20
    # warn: 10
    # scsi:
    # critical: true
    # standard: true
    # nvme:
    # critical: true
    # standard: true
  3. Configure the SMTP notification URL:

    • Locate the notify: section
    • Uncomment the SMTP line
    • Replace username:password@host:port with your SMTP server details
    • Set fromAddress to the email address notifications should come from
    • Set toAddresses to recipient email addresses (comma-separated for multiple recipients)
  4. Important: URL encode special characters in usernames and passwords:

    • Replace @ with %40
    • Replace . with %2E
    • Replace $ with %24

    Example: If your username is [email protected] and password is 124@34$1, the URL becomes:

    smtp://myname%40example%2Ecom:124%4034%[email protected]:587/[email protected][email protected]
  5. Restart the Scrutiny web service to apply changes:

    cd /opt/docker/scrutiny
    docker compose restart web

Additional Notification Services

Scrutiny supports multiple notification services via Shoutrrr. You can enable multiple services simultaneously by uncommenting additional URLs in the notify.urls section:

  • Discord
  • Telegram
  • Pushover
  • Slack
  • Microsoft Teams
  • Gotify
  • Pushbullet
  • IFTTT
  • Mattermost
  • Ntfy
  • Google Hangouts
  • Zulip
  • Join
  • Custom scripts
  • Webhooks

Setup Scrutiny Collector on Windows

The Scrutiny collector binary can be run on Windows to gather SMART metrics and send them to your Scrutiny web server. This guide explains how to install prerequisites, configure the collector, and run it.


1. Install Smartmontools

Scrutiny relies on smartctl from smartmontools.

  • Download and install the Windows package.
  • During installation, check the option to add smartctl to PATH.
  • Verify installation:
smartctl --version

2. Download the Scrutiny Collector Binary

C:\scrutiny\

3. Run the Collector

You can run the collector manually from PowerShell:

cd C:\scrutiny
.\scrutiny-collector-metrics-windows-amd64.exe run --api-endpoint "http://<server-ip>:8091" --host-id "MyWindowsPC"
  • Replace <server-ip> with the IP or hostname of your Scrutiny web server.
  • Set --host-id to a friendly name for this computer (e.g. MyWindowsPC). This name will appear in the Scrutiny dashboard.

4. Optional: Configuration File

Instead of passing flags every time, you can create a config file:

C:\opt\scrutiny\config\collector.yaml

Example:

api:
endpoint: http://<server-ip>:8091
host:
id: MyWindowsPC

Then run simply:

.\scrutiny-collector-metrics-windows-amd64.exe run

5. Automate with Task Scheduler

To collect metrics regularly:

  1. Open Task Scheduler.
  2. Create a new task:
    • Program/script: C:\scrutiny\scrutiny-collector-metrics-windows-amd64.exe
    • Arguments: run --api-endpoint "http://<server-ip>:8091" --host-id "MyWindowsPC"
    • Start in: C:\scrutiny
  3. Check Run with highest privileges.
  4. Set a trigger (e.g. daily).
  5. Save the task.

6. Verify in Dashboard

After the collector runs, drives from this Windows PC will appear in the Scrutiny dashboard under the configured Host ID.


Run once from PowerShell to test connectivity.


Setup Scrutiny Collector on Linux

For remote Linux machines that need to report SMART metrics to your Scrutiny server, you can deploy a standalone collector using Docker.

Deploy the Collector

  1. Create the directory structure and set ownership:

    sudo mkdir -p /opt/docker/scrutiny-collector
    sudo chown -R $USER:$USER /opt/docker
    cd /opt/docker/scrutiny-collector
  2. Create the docker-compose.yml file with the following configuration:

    name: scrutiny
    services:
    collector:
    image: ghcr.io/analogj/scrutiny:master-collector
    restart: unless-stopped
    cap_add:
    - SYS_RAWIO
    - SYS_ADMIN
    volumes:
    - /run/udev:/run/udev:ro
    environment:
    COLLECTOR_API_ENDPOINT: 'http://server:8091'
    COLLECTOR_HOST_ID: 'Legion'
    COLLECTOR_RUN_STARTUP: true
    devices:
    - "/dev/nvme0"
    - "/dev/nvme1"
    - "/dev/sde"
    - "/dev/sdg"
    - "/dev/sdf"
    - "/dev/sdd"
    - "/dev/sdb"
    - "/dev/sda"
    - "/dev/sdc"
  3. Update the configuration:

    • Replace server in COLLECTOR_API_ENDPOINT with your Scrutiny server's IP or hostname
    • Set COLLECTOR_HOST_ID to a unique name for this machine (e.g., Legion, ProxmoxHost, etc.)
    • Update the devices: section with the drives on this machine
  4. Start the collector:

    docker compose up -d

Configuration Notes

  • API Endpoint: Must point to your Scrutiny web server (port 8091 by default)
  • Host ID: Uniquely identifies this collector in the dashboard
  • Devices: List all drives you want to monitor on this machine
  • Run on Startup: COLLECTOR_RUN_STARTUP: true ensures metrics are collected immediately when the container starts
  • The collector will automatically run on a schedule after the initial startup

Device Discovery

To find your device names on this Linux machine:

lsblk
# or
ls -la /dev/sd* /dev/nvme*

Add each drive you want to monitor to the devices: section in the collector service.

Verify Collection

After deploying, check the logs to ensure successful connection:

docker compose logs -f collector

The drives from this machine should appear in your Scrutiny dashboard under the configured Host ID.


Resources & Documentation

Official Documentation

Tools

Buy me a beer


💬 Discord Community Chat

Join the conversation! Comments here sync with our Discord community.

💬 Recent Comments

Loading comments...
💬Join Discord
Buy me a coffee