rycochet/zfs-discord-alerts

By rycochet

Updated 7 months ago

Monitor your ZFS pools effortlessly and receive near real-time alerts in Discord.

Image
Monitoring & observability
0

812

rycochet/zfs-discord-alerts repository overview

zfs-discord-alerts

GitHub Actions Workflow Status GitHub contributors Docker Pulls Docker Image Size

Monitor your ZFS pools effortlessly and receive near real-time alerts in Discord.

Features

  • Real-Time Reporting: Runs every 5 minutes and tells discord instantly when something changes.
  • Discord Notifications: Sends event alerts to a Discord channel using webhooks (no bot required).
  • Rich Embeds: Optional detailed information.
  • Configurable: Easily customize alerts using a ENV vars.
  • Dockerized: Run the script as a background service using Docker Compose.

Prerequisites

  • Docker and Docker Compose installed on your system.
  • A Discord account and a webhook URL from your server.

Usage

  1. Create a compose.yaml file

    An example compose.yaml file is included, make sure you replace the DISCORD_WEBHOOK_URL value with one you obtained from Discord:

    services:
        zfs-discord-alerts:
            container_name: zfs-discord-alerts
            image: ghcr.io/rycochet/zfs-discord-alerts:latest
            restart: unless-stopped
            environment:
                DISCORD_WEBHOOK_URL: "https://discord.com/api/webhooks/..."
    
  2. Start the Service

    Use Docker Compose to start the service in the background:

    docker-compose up -d
    
  3. Trigger ZFS Events

    Unplug a drive and plug it back in...

    ...Seriously, don't do this - it just works!

  4. Check Discord

    Notifications will appear in the designated Discord channel with details when something in the pools changes.

    There will be an initial message when starting, even if it only says that everything is ONLINE (healthy).

Troubleshooting
  • Ensure Docker and Docker Compose are running correctly.

  • Verify that the Discord webhook URL is correct and active.

  • Check for any errors in the container logs:

    docker logs zfs-discord-alerts
    

Environment Variables

NameDefinitionDefault
CHECK_DELAYThe number of seconds between checks.300
DISCORD_WEBHOOK_URLRequired
The full webhook URL from Discord.
EXTRAA string to send with every alert, perfect for sending @mentions for people. You need to obtain the ID and format as <@USER_ID> or <@&ROLE_ID>, but can put any text here.
LOG_LEVELHow much to log: DEBUG, INFO, WARNING, ERROR, CRITICALINFO
POOLSA space separated list of pools to check, by default it will check everything.
SHOW_SPACEWhether to show the space used, this will send an update to Discord when it changes at about 0.1 units (Gb / Tb / Pb etc). (True / False)False
VERBOSEProvide more detail for the Discord messages. (True / False)False

Tag summary

Content type

Image

Digest

sha256:f2748c806

Size

24.4 MB

Last updated

7 months ago

docker pull rycochet/zfs-discord-alerts