tutorial

MeTube Monitoring with Vigilmon: Uptime, WebSocket Health & Download Pipeline Checks

Monitor your MeTube self-hosted video downloader with Vigilmon — track web UI availability, WebSocket connectivity for download progress, storage health, SSL certificates, and scheduled download heartbeats.

MeTube is your self-hosted front end for yt-dlp — a clean web interface to queue YouTube videos, playlists, and audio downloads on your own server. But when MeTube goes down, your scheduled downloads stop silently. The queue just sits there. You don't find out until you check the library and the episode you wanted to watch isn't there.

Vigilmon gives MeTube the external monitoring layer it doesn't include by default: web UI uptime, WebSocket server health for live download progress, storage availability checks, SSL certificate monitoring, and heartbeat monitoring to confirm your scheduled downloads are completing.

This tutorial walks through setting up full MeTube monitoring with Vigilmon.

What You'll Build

  • A Vigilmon HTTP monitor on MeTube's web UI
  • A WebSocket connectivity check for the download progress feed
  • An SSL certificate monitor for proxied deployments
  • A heartbeat monitor to confirm scheduled downloads complete

Prerequisites


Step 1: Monitor the Web UI

MeTube doesn't expose a dedicated health API endpoint, so the primary health check is the web UI itself. When MeTube's Flask backend is running and healthy, the root URL returns a 200 with the download queue interface.

Test it:

curl -s -o /dev/null -w "%{http_code}" http://localhost:8081/

Expected output: 200

Set up the Vigilmon monitor:

  1. Log in to Vigilmon and click New Monitor → HTTP.
  2. Set URL to https://metube.yourdomain.com/ (or http://your-server-ip:8081/).
  3. Set Check interval to 60 seconds.
  4. Set Expected status code to 200.
  5. Under Advanced → Keyword check:
    • Keyword present: MeTube
  6. Save the monitor.

MeTube's HTML includes "MeTube" in the page title. If the Flask process crashes, the Nginx/Caddy proxy returns a 502, or the app fails to start, this check fires immediately.


Step 2: Monitor WebSocket Server Connectivity

MeTube uses a WebSocket connection to stream real-time download progress to the browser. The WebSocket endpoint runs on the same port as the web UI (/ws). If the WebSocket server is not responding, the UI loads but download progress never appears — queued downloads may be running but the interface shows no feedback.

You can test WebSocket connectivity with a simple HTTP check on the WebSocket upgrade path, or by asserting the UI loads correctly (which requires the WebSocket server to be initialized):

  1. Click New Monitor → HTTP in Vigilmon.
  2. Set URL to https://metube.yourdomain.com/.
  3. Set Expected status code to 200.
  4. Under Advanced → Keyword check:
    • Keyword present: socket
  5. Set Check interval to 2 minutes.
  6. Save.

MeTube's frontend HTML includes WebSocket initialization code with references to the socket connection. If the WebSocket endpoint is misconfigured or missing from the served HTML, this keyword check catches it.

For deeper WebSocket connectivity testing, use a simple monitoring script on your server:

#!/bin/bash
# Save as /opt/scripts/check-metube-ws.sh
python3 -c "
import websocket, sys
try:
    ws = websocket.create_connection('ws://localhost:8081/ws', timeout=5)
    ws.close()
    sys.exit(0)
except:
    sys.exit(1)
"

Pair this with the heartbeat monitor in Step 4 to get an end-to-end confirmation.


Step 3: Monitor Download Storage Availability

MeTube writes downloads to a configured output directory (typically mounted as a Docker volume). If the storage becomes full, read-only due to a disk error, or unmounted, MeTube will fail silently — yt-dlp starts downloading but can't write the output file.

Add a disk space check on your server using a cron job that pings a Vigilmon heartbeat only when storage is healthy:

#!/bin/bash
# Save as /opt/scripts/check-storage.sh
DOWNLOAD_DIR="/path/to/metube/downloads"
THRESHOLD=90  # alert if usage exceeds 90%
HEARTBEAT_URL="https://vigilmon.online/ping/storage-abc123"

USAGE=$(df "$DOWNLOAD_DIR" | awk 'NR==2 {print $5}' | tr -d '%')
if [ "$USAGE" -lt "$THRESHOLD" ]; then
    curl -s "$HEARTBEAT_URL" > /dev/null
fi

Set up the storage heartbeat in Vigilmon:

  1. Click New Monitor → Heartbeat.
  2. Set Name to MeTube Download Storage.
  3. Set Expected interval to 5 minutes.
  4. Set Grace period to 10 minutes.
  5. Copy the heartbeat URL and put it in the script above.
  6. Save.

Add the script to cron:

*/5 * * * * /opt/scripts/check-storage.sh

When disk usage exceeds 90%, the heartbeat ping stops and Vigilmon alerts you before MeTube starts failing downloads.


Step 4: Heartbeat Monitor for Scheduled Downloads

If you use MeTube with scheduled or automated download queues (through its API or external scripts), a heartbeat monitor confirms that the full download pipeline — queue submission, yt-dlp execution, and file write — is completing successfully.

Set up a post-download heartbeat:

  1. In Vigilmon, click New Monitor → Heartbeat.
  2. Set Name to MeTube Scheduled Downloads.
  3. Set Expected interval to match your download schedule (e.g., 1 hour for hourly scheduled runs).
  4. Set Grace period to 15 minutes.
  5. Copy the generated ping URL (e.g., https://vigilmon.online/ping/metube-dl-xyz).
  6. Save.

Then modify your download script to ping Vigilmon on successful completion:

#!/bin/bash
# Submit download via MeTube API and ping heartbeat on success
METUBE_URL="http://localhost:8081"
HEARTBEAT_URL="https://vigilmon.online/ping/metube-dl-xyz"
VIDEO_URL="$1"

RESPONSE=$(curl -s -X POST "$METUBE_URL/add" \
  -H "Content-Type: application/json" \
  -d "{\"url\": \"$VIDEO_URL\", \"quality\": \"best\"}")

if echo "$RESPONSE" | grep -q '"status":"ok"'; then
    curl -s "$HEARTBEAT_URL" > /dev/null
fi

When your scheduled download pipeline stops — whether because MeTube is down, yt-dlp fails, or the automation script crashes — the heartbeat misses its window and Vigilmon sends an alert.


Step 5: SSL Certificate Monitoring

For HTTPS deployments behind a reverse proxy:

  1. Open your MeTube HTTPS monitor.
  2. Go to Advanced → SSL / TLS.
  3. Enable Check SSL certificate.
  4. Set Warn when expires in to 14 days.
  5. Save.

Self-hosted services are common targets for Let's Encrypt renewal failures, especially after server reboots or firewall changes that block port 80. Vigilmon catches this before the certificate expires.


Step 6: Alert Channels

Go to Notifications → New Channel in Vigilmon and configure:

  • Email — direct to you or your server admin
  • Webhook — to Slack, Discord, or a custom endpoint

Example alert when the download heartbeat goes missing:

🔴 DOWN: MeTube Scheduled Downloads (heartbeat missed)
Last ping received: 2026-05-01 10:00 UTC
Expected: every 60 minutes
Triggered: 2026-05-01 11:15 UTC

Recovery notification:

✅ RECOVERED: MeTube Scheduled Downloads
Missed window: 75 minutes

What You've Built

| Scenario | How Vigilmon catches it | |---|---| | MeTube process crash | HTTP monitor detects 502 or connection refused | | Flask backend error | HTTP monitor detects non-200 response | | WebSocket server broken | Keyword monitor misses socket in HTML | | Download storage full | Storage heartbeat stops pinging | | Scheduled downloads stalled | Download heartbeat misses expected window | | SSL certificate expired | TLS check on HTTPS monitor fires | | Reverse proxy down | HTTP monitor detects 502 or DNS failure |


MeTube runs quietly and downloads in the background — which means failures are also quiet. Vigilmon gives you the external watch that keeps your download pipeline healthy, your storage free, and your media library growing on schedule.

Start monitoring MeTube today — register free at vigilmon.online.

Monitor your app with Vigilmon

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

Start free →