Sign inSign up

fireinice/smart-sniffer

By fireinice

•Updated 5 months ago

https://www.github.com/fireinice/docker-smart-sniffer

Image
0

432

fireinice/smart-sniffer repository overview

⁠Docker Smart Sniffer

A lightweight, Dockerized agent for monitoring disk SMART data. This project automatically detects your system's physical disks (SATA/SAS and NVMe) and generates a tailored Docker Compose configuration with the minimum required security capabilities. You can read more info from DAB-LABS/smart-sniffer⁠.

⁠Features

  • Auto-Detection: Automatically identifies all physical disks and maps them to the container.
  • Smart Security: Only requests necessary Linux capabilities (SYS_RAWIO for SATA, SYS_ADMIN for NVMe) instead of running in full privileged mode.
  • Multi-Arch Support: Supports both amd64 and arm64 architectures.
  • mDNS Discovery: Optimized for auto-discovery (e.g., within Home Assistant) using host networking.
  • Configurable: Easily adjust scan intervals, ports, and authentication tokens.

⁠Quick Start

The easiest way to get started is to use the provided generation script, which scans your hardware and creates a docker-compose.yaml file for you.

⁠1. Generate Configuration

Run the generation script. You can optionally pass environment variables to customize the configuration:

# Default generation
chmod +x gen_service.sh
./gen_service.sh

# Or with custom settings
PORT=9099 INTERVAL=30s TOKEN=your_secret_token AGENT_HOSTNAME=my-custom-agent ./gen_service.sh
⁠2. docker compose example:
  smart-agent:
    image: fireinice/smart-sniffer:latest
    container_name: smart-agent
    # using hostname to avoid mDNS name conflicts
    hostname: my-nas-disks
    cap_add:
      # Required for NVMe SMART data
      - SYS_ADMIN
      # Required for SATA/SAS SMART data
      - SYS_RAWIO"
    # required for mDNS auto discovery
    # or using macvlan with home assistant
    network_mode: host
    environment:
      # INTERVAL, TOKEN and PORT for service configuration
      - INTERVAL=60s
      - PORT=9099
    devices:
      - "/dev/nvme0n1:/dev/nvme0n1"
      - "/dev/sda:/dev/sda"
    restart: unless-stopped

### 3. Deploy

Once the `docker-compose.yaml` is generated, start the service:

```bash
docker compose up -d

⁠Configuration

The following environment variables can be set during generation or modified directly in the generated docker-compose.yaml:

VariableDefaultDescription
PORT9099The port the agent will listen on.
INTERVAL60sHow often the agent scans disk health.
TOKEN(None)Optional authentication token for the agent.
AGENT_HOSTNAMEsmart-agent-XXXXXCustom hostname for the container (randomly generated if unset).

⁠How it Works

  1. Hardware Scanning: gen_service.sh uses lsblk to find all physical disks.
  2. Capability Mapping:
    • If SATA/SAS disks are found, it adds SYS_RAWIO.
    • If NVMe disks are found, it adds SYS_ADMIN.
  3. Binary Provisioning: The Dockerfile uses download.sh to fetch the latest specialized smart-agent binary from

Tag summary

Content type

Image

Digest

sha256:ae9ca95d5…

Size

32.1 MB

Last updated

5 months ago

docker pull fireinice/smart-sniffer