tutorial

Monitoring Deluge with Vigilmon

Deluge runs as a headless daemon and a separate Web UI — here's how to monitor both layers plus the daemon's RPC port with Vigilmon so you catch the "Not connected to daemon" failure before it silently stalls your downloads.

Deluge's daemon/client architecture is its biggest strength in resource-constrained homelab environments — deluged runs headlessly on a Raspberry Pi or low-RAM NAS while deluge-web serves the browser interface from the same box. But that split architecture introduces a failure mode that single-process BitTorrent clients don't have: the Web UI can be fully reachable while the daemon it depends on is down, leaving users staring at "Not connected to daemon." Vigilmon lets you monitor the Web UI, the JSON-RPC API, and the daemon's TCP port independently so you know exactly which layer failed.

What You'll Set Up

  • HTTP monitor for the Deluge Web UI (port 8112)
  • JSON-RPC API health check via the session endpoint
  • TCP probe for the Deluge daemon RPC port (port 58846)
  • SSL certificate expiry alerts for reverse-proxied HTTPS deployments
  • Heartbeat monitor for Deluge daemon stats and disk space health

Prerequisites

  • Deluge installed with deluged running on port 58846 and deluge-web on port 8112
  • Web UI accessible over HTTP or HTTPS
  • A free Vigilmon account

Step 1: Monitor the Deluge Web UI

The Deluge Web UI is served by deluge-web, a Python HTTP server running on port 8112. A GET / returning HTTP 200 with the Ext.js application payload confirms that deluge-web is alive.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Deluge Web UI URL: http://your-server:8112/
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Under Keyword check, enter Deluge to confirm you're getting the Deluge web app, not a default nginx page.
  7. Click Save.

This catches deluge-web crashing, the Python process running out of memory, or the port becoming unreachable due to a firewall rule change. It does not catch daemon failures — the Web UI will return 200 even when the daemon is down.


Step 2: Monitor the Deluge JSON-RPC API

Deluge Web uses a JSON-RPC over HTTP API at /json. The auth.check_session method accepts any session ID and returns false for an unauthenticated session — but a valid JSON-RPC response confirms the API endpoint is processing requests:

POST http://your-server:8112/json
Content-Type: application/json

{"method": "auth.check_session", "params": ["sessionid"], "id": 1}

Expected response:

{"result": false, "error": null, "id": 1}

A 500 response or a non-JSON body means deluge-web is broken at the API layer even if the / page is loading.

Add this monitor in Vigilmon:

  1. Click Add MonitorHTTP / HTTPS.
  2. URL: http://your-server:8112/json
  3. Method: POST
  4. Request body: {"method": "auth.check_session", "params": ["sessionid"], "id": 1}
  5. Request header: Content-Type: application/json
  6. Expected status: 200.
  7. Keyword check: result — confirms the JSON-RPC response is well-formed.
  8. Check interval: 2 minutes.
  9. Click Save.

Step 3: Monitor the Deluge Daemon TCP Port

The Deluge daemon (deluged) listens on TCP port 58846 for RPC connections from deluge-web and desktop clients. If deluged crashes, the Web UI will appear fully functional but show "Not connected to daemon" and refuse to display or manage torrents.

Monitor this TCP port directly:

  1. Click Add MonitorTCP Port.
  2. Host: your-server
  3. Port: 58846
  4. Check interval: 1 minute.
  5. Click Save.

A TCP failure here is the authoritative signal that deluged is down — escalate this alert to your highest-priority channel since no torrent activity is possible until the daemon restarts.

On systemd-based Linux, verify the daemon service is configured to restart automatically:

sudo systemctl status deluged
# If not enabled:
sudo systemctl enable deluged

Add the restart policy to /etc/systemd/system/deluged.service if missing:

[Service]
Restart=on-failure
RestartSec=10s

Step 4: SSL Certificate Alerts for HTTPS Deluge Deployments

Deluge Web does not support HTTPS natively — you run it behind nginx or Caddy for SSL termination. Monitor the certificate on your proxy domain:

  1. Open the HTTPS monitor pointing to https://deluge.yourdomain.com/.
  2. Enable Monitor SSL certificate.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

A sample nginx configuration for Deluge:

server {
    listen 443 ssl;
    server_name deluge.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/deluge.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/deluge.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://localhost:8112;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

Step 5: Heartbeat Monitoring for Daemon Stats and Disk Space

The core.get_stats JSON-RPC method returns real-time download speed, upload speed, free disk space, and cumulative payload statistics from the daemon. A scheduled heartbeat that calls this method and checks for free space catches disk-full conditions before Deluge auto-pauses all downloads.

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set Expected ping interval to 15 minutes.
  3. Copy the heartbeat URL (e.g. https://vigilmon.online/heartbeat/abc123).
  4. Add a cron job on your Deluge server:
crontab -e
*/15 * * * * COOKIE=$(curl -s -c /tmp/deluge_cookies.txt -b /tmp/deluge_cookies.txt \
  -X POST http://localhost:8112/json \
  -H "Content-Type: application/json" \
  -d '{"method":"auth.login","params":["your-web-password"],"id":1}' | \
  grep -o '"result": *true') && \
  [ -n "$COOKIE" ] && \
  FREE=$(curl -s -b /tmp/deluge_cookies.txt \
  -X POST http://localhost:8112/json \
  -H "Content-Type: application/json" \
  -d '{"method":"core.get_stats","params":[],"id":2}' | \
  python3 -c "import sys,json; d=json.load(sys.stdin); print(d['result']['free_space'])") && \
  [ "$FREE" -gt 1073741824 ] && \
  curl -s https://vigilmon.online/heartbeat/abc123

This script:

  1. Authenticates to deluge-web
  2. Calls core.get_stats to get daemon statistics including free_space
  3. Checks that free disk space exceeds 1 GB (adjust to your threshold)
  4. Only pings the Vigilmon heartbeat if both the daemon is reachable AND disk space is sufficient

If the daemon is down, the authentication fails and the heartbeat is skipped. If disk space drops below 1 GB, Deluge will soon auto-pause downloads and the heartbeat stops — Vigilmon alerts after the interval passes.


Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add email, Slack, or a webhook.
  2. Set Consecutive failures before alert to 2 on the Web UI HTTP monitor.
  3. Set Consecutive failures to 1 on the TCP port monitor — a daemon failure breaks all torrent activity immediately and needs immediate attention.

Summary

| Monitor | URL / Check | What It Catches | |---|---|---| | Web UI | http://your-server:8112/ | deluge-web crash, port unreachable | | JSON-RPC API | POST /json (auth.check_session) | API layer broken, Python errors | | Daemon TCP | TCP :58846 | deluged crash, "Not connected to daemon" | | SSL certificate | Your reverse-proxy domain | Let's Encrypt renewal failure | | Cron heartbeat | core.get_stats method | Daemon unreachable, disk full condition |

The layered architecture of deluged + deluge-web means you can have a green HTTP check while torrents are completely stalled. With Vigilmon monitoring all three layers — Web UI, JSON-RPC API, and the daemon TCP port — plus a disk space heartbeat, you have the full observability picture that catches every failure mode before your download queue piles up.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →