Skip to content

Unraid

Unraid runs a script for each notification when you add it as a notification agent. This script sends each one to Pocketbell, with Unraid’s alerts as Critical.

This uses an API Source.

  1. In the Pocketbell app, create a Source named Unraid, choose API, and copy its key.

  2. Save this as /boot/config/plugins/dynamix/notifications/agents/Pocketbell.sh, with your key in place of pb_live_…:

    #!/bin/bash
    KEY="pb_live_…"
    case "$IMPORTANCE" in
    alert) PRIORITY=critical ;;
    warning) PRIORITY=important ;;
    *) PRIORITY=normal ;;
    esac
    jq -n --arg title "$SUBJECT" --arg message "$DESCRIPTION" --arg priority "$PRIORITY" \
    '{title: $title[0:250], message: (if $message == "" then $title else $message end)[0:4096],
    priority: $priority, tags: ["unraid"]}' |
    curl -fsS https://api.pocketbell.dev/v1/messages \
    -H "Authorization: Bearer $KEY" \
    -H "Content-Type: application/json" \
    --data @-
  3. Make it executable: chmod +x the file. The script needs jq: check that jq --version answers in Unraid’s terminal.

  4. In Settings → Notification Settings, tick Agents for the kinds of notification to send.

  5. Send a test from the terminal:

    Terminal window
    /usr/local/emhttp/webGui/scripts/notify -e Test -s "Test from Unraid" -d "Hello" -i alert
  • Unraid’s alert is Critical, repeating until you acknowledge it; warning is Time Sensitive; everything else is normal.
  • jq --arg makes each value a JSON string, so text with quotes in it still makes a valid request.
  • The flash drive keeps the script across reboots, and the key with it, so keep the flash backup private.