tutorial

How to Monitor Your Discourse Forum with Vigilmon

Keep your self-hosted Discourse forum healthy — monitor the status endpoint, web UI availability, Sidekiq job queues, and SSL certificate expiry with Vigilmon.

Discourse is one of the richest self-hosted forum platforms available, but that richness comes with complexity: a Ruby on Rails backend, a PostgreSQL database, Redis for the job queue, and Sidekiq workers processing notifications, emails, and post digests in the background. When any layer fails, users may see broken image uploads, missing notification emails, or a completely blank page. Vigilmon catches these failures from the outside, before your community starts posting "is the site down?" threads somewhere else.

What You'll Set Up

  • Vigilmon HTTP monitor for the Discourse web UI
  • A monitor for the /srv/status built-in health endpoint
  • A Sidekiq queue heartbeat check (via cron)
  • SSL certificate expiry alerts

Prerequisites

  • A self-hosted Discourse instance (standard Docker install or bare-metal)
  • A free Vigilmon account
  • Shell (SSH) access to the Discourse host

Why Discourse Needs Deep Monitoring

Discourse serves forum content through a combination of server-side rendering and a client-side Ember.js app. When the Rails app is healthy but Sidekiq workers have stopped, the forum appears completely functional to users browsing topics — but new post notifications never arrive, emails stop, and search indexing falls behind. A simple uptime check misses this entire class of failure.

Vigilmon's combination of HTTP monitoring, health endpoint probing, and heartbeat checks covers the full stack.


Step 1: Monitor the Discourse Web UI

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Discourse URL — typically https://forum.yourdomain.com.
  4. Set Check interval to 1 minute.
  5. Set Expected status code to 200.
  6. Click Save.

This catches reverse proxy failures, Rails crashes, and PostgreSQL connection errors that prevent the forum from loading.


Step 2: Monitor the /srv/status Health Endpoint

Discourse ships a built-in status endpoint at /srv/status. It is a JSON document that reports the Discourse version and confirms the app is running:

{
  "pg_readonly_mode": false,
  "recently_readonly": false,
  "server_ramping_up": false
}

When pg_readonly_mode is true, Discourse has detected a database problem and entered a degraded state where new posts are rejected. Vigilmon can probe this:

  1. In Vigilmon, click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter https://forum.yourdomain.com/srv/status.
  4. Set Expected status code to 200.
  5. Set Expected body contains to "pg_readonly_mode":false — this alerts you if Discourse enters readonly mode.
  6. Set Name to Discourse – /srv/status.
  7. Click Save.

This single check gives you visibility into PostgreSQL health that the homepage monitor cannot.


Step 3: Monitor Sidekiq Worker Health via Heartbeat

Sidekiq is Discourse's background job processor. It handles email delivery, notifications, post digests, badge awards, and search indexing. If Sidekiq stops, the forum appears healthy but background work silently queues up without being processed.

Discourse includes a built-in admin Sidekiq UI at /sidekiq — but checking it manually is impractical. Instead, use a cron job that runs a simple Sidekiq health query and pings a Vigilmon heartbeat.

Create the Heartbeat Monitor

  1. In Vigilmon, click Add MonitorHeartbeat / Cron.
  2. Set Name to Discourse – Sidekiq Workers.
  3. Set Expected interval to 15 minutes.
  4. Click Save — note the generated heartbeat URL (e.g. https://vigilmon.online/heartbeat/xyz789).

Add a Health-Check Script

Create /usr/local/bin/check-discourse-sidekiq.sh:

#!/bin/bash
# Check that Discourse Sidekiq has running workers and ping Vigilmon heartbeat

HEARTBEAT_URL="https://vigilmon.online/heartbeat/xyz789"

# For Docker installs: check Sidekiq process inside the container
WORKER_COUNT=$(docker exec app /bin/bash -c \
  "cd /var/www/discourse && bundle exec rails runner \
  'puts Sidekiq::ProcessSet.new.size'" 2>/dev/null)

if [[ "$WORKER_COUNT" =~ ^[1-9][0-9]*$ ]]; then
  # Workers are running — ping the heartbeat
  curl -fsS --retry 3 "$HEARTBEAT_URL" > /dev/null 2>&1
else
  echo "Discourse Sidekiq workers not found (count: $WORKER_COUNT)" >&2
  # No ping — Vigilmon will alert after the window expires
fi

Make it executable:

chmod +x /usr/local/bin/check-discourse-sidekiq.sh

Add to system cron (crontab -e):

*/10 * * * * /usr/local/bin/check-discourse-sidekiq.sh

If Sidekiq workers stop, the heartbeat ping stops arriving and Vigilmon alerts you after 15 minutes.


Step 4: Configure Response Time Thresholds

Discourse topic pages involve multiple database queries, Redis reads, and CDN asset fetches. Slow response times are an early warning of database or Redis pressure.

  1. Open your primary Discourse monitor in Vigilmon.
  2. Find Response time threshold.
  3. Set Warn to 1200ms and Critical to 3500ms.
  4. Save.

Step 5: Enable SSL Certificate Monitoring

An expired SSL certificate locks every user out of the forum and prevents Discourse from sending outbound webhook calls.

  1. Open your Discourse web UI monitor.
  2. Enable Alert when certificate expires within 14 days.
  3. Save.

Discourse's default Docker install uses Let's Encrypt and auto-renews. However, renewal can silently fail if port 80 is blocked or the container restarts at the wrong moment — Vigilmon's certificate check catches these edge cases.


Step 6: Configure Notifications

  1. Go to Alert ChannelsAdd ChannelSlack webhook (or email).
  2. Paste your Slack webhook URL with a Discourse-themed payload:
{
  "text": "💬 *{{monitor_name}}* is {{status}}!\nURL: {{url}}\nTime: {{timestamp}}"
}
  1. Attach the channel to all your Discourse monitors so the whole team is notified on any alert.

Step 7: Verify the Full Setup

  1. Test the /srv/status alert: Temporarily change the Expected body contains value to something you know won't appear in the response (e.g. "test_fail_123"), confirm the alert fires, then restore the correct value.
  2. Test the heartbeat: Stop the cron job and wait for the 15-minute window to expire — confirm the Sidekiq alert arrives. Re-enable cron and confirm recovery.
  3. Test SSL alerts: If you have a test domain with an expiring cert, point a monitor at it — or manually trigger a test alert from within Vigilmon.

Going Further

  • Email delivery monitoring: Discourse sends transactional emails via SMTP. Add a Vigilmon monitor for your SMTP relay (STARTTLS port 587) using a TCP port monitor so SMTP failures surface before users stop receiving notifications.
  • Redis port check: Add a TCP monitor for port 6379 on your Redis host — Discourse degrades silently when Redis is unreachable.
  • Multiple regions: Vigilmon probes from multiple geographic locations. If your community is global, the multi-region consensus removes false positives from regional network blips while still catching real outages.
  • Status page: Embed a Vigilmon status widget on a public status page — your community members can check it themselves during an incident instead of flooding the forum with "is it down for you?" posts.

With Vigilmon monitoring the full Discourse stack — web UI, health endpoint, Sidekiq workers, and SSL certificate — your community never has to wonder why notifications stopped or why the forum feels broken.

Monitor your app with Vigilmon

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

Start free →