tutorial

Monitoring The Lounge IRC Client with Vigilmon

The Lounge is a self-hosted web IRC client that stays connected 24/7 — here's how to monitor its Node.js server, WebSocket health, IRC upstream connections, and TLS certificates with Vigilmon.

The Lounge keeps your IRC sessions alive around the clock — but when its Node.js process crashes or a WebSocket connection silently drops, your users lose access to chat history and real-time messages without any warning. Vigilmon gives you HTTP uptime checks, WebSocket endpoint health, and TLS certificate alerts so you find out before your users do.

What You'll Set Up

  • HTTP uptime monitor for The Lounge web UI (port 9000)
  • WebSocket health check via the /socket.io endpoint
  • Login endpoint availability monitoring
  • TLS certificate expiry alerts
  • Cron heartbeat for the Node.js process

Prerequisites

  • The Lounge installed and running (thelounge or Docker), accessible over HTTP/HTTPS
  • A free Vigilmon account

Step 1: Monitor the Web UI

The Lounge serves its web UI from a Node.js HTTP server, typically on port 9000. Add an HTTP monitor in Vigilmon:

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Lounge URL: https://lounge.yourdomain.com (or http://your-server-ip:9000 if not behind a reverse proxy).
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Click Save.

If you serve The Lounge through an nginx or Caddy reverse proxy (recommended for HTTPS), monitor the public URL so the check validates the full stack including the proxy.


Step 2: Check the WebSocket Endpoint

The Lounge uses Socket.IO for real-time message delivery between the browser and the Node.js server. A failed WebSocket handshake means users cannot receive or send messages even if the HTTP server is up.

Probe the Socket.IO polling fallback endpoint — this responds with an HTTP 200 to GET requests:

  1. Add a second Vigilmon monitor with Type HTTP / HTTPS.
  2. Set the URL to: https://lounge.yourdomain.com/socket.io/?EIO=4&transport=polling
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 2 minutes.
  5. Click Save.

A non-200 here indicates the Socket.IO server is broken or the reverse proxy is misconfigured for WebSocket upgrades.

If you run nginx, verify WebSocket proxying is enabled:

location /socket.io/ {
    proxy_pass http://127.0.0.1:9000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
}

Step 3: Monitor the Login Endpoint

The Lounge's /login endpoint is where user authentication happens. If this route is down, no new client sessions can be established.

  1. Add a Vigilmon monitor with Type HTTP / HTTPS.
  2. Set the URL to: https://lounge.yourdomain.com/login
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 5 minutes.
  5. Click Save.

Step 4: Add a Process Heartbeat

The Lounge's Node.js process should emit a periodic heartbeat so Vigilmon can detect silent crashes. Add a cron job that POSTs to a Vigilmon heartbeat URL:

  1. In Vigilmon, click Add MonitorCron Job / Heartbeat.
  2. Set Expected interval to 5 minutes.
  3. Copy the heartbeat URL shown (e.g., https://vigilmon.online/ping/your-heartbeat-id).

Add the cron job on your server:

# /etc/cron.d/thelounge-heartbeat
*/5 * * * * root curl -fsS --retry 3 https://vigilmon.online/ping/your-heartbeat-id > /dev/null 2>&1

If The Lounge crashes and the cron job cannot reach the ping URL, Vigilmon marks the heartbeat as missed and alerts you.

Alternatively, wrap the heartbeat in a systemd ExecStartPost or include it in a lightweight shell wrapper around the thelounge process.


Step 5: TLS Certificate Expiry

The Lounge communicates over WebSocket — a bad or expired TLS certificate breaks all browser connections immediately (browsers refuse WS upgrades on untrusted certs).

  1. Open the HTTP / HTTPS monitor you created in Step 1.
  2. Enable Monitor SSL certificate.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

If you use Let's Encrypt with Certbot, also verify your renewal cron or systemd timer is active:

systemctl status certbot.timer

Step 6: Multi-User Health Logging

In multi-user mode, The Lounge maintains a persistent IRC connection per configured user. You can expose a simple status endpoint with a small wrapper script and monitor it:

// health-check.js — run as a separate tiny HTTP server
const http = require('http');
const { execSync } = require('child_process');

http.createServer((req, res) => {
  if (req.url !== '/health') { res.writeHead(404); res.end(); return; }
  try {
    // Check The Lounge process is running
    execSync('pgrep -f thelounge');
    res.writeHead(200, { 'Content-Type': 'application/json' });
    res.end(JSON.stringify({ status: 'ok' }));
  } catch {
    res.writeHead(503, { 'Content-Type': 'application/json' });
    res.end(JSON.stringify({ status: 'down' }));
  }
}).listen(9001);

Run this alongside The Lounge and add a Vigilmon monitor at http://your-server:9001/health expecting a 200.


Step 7: Configure Alerts

Set up alert channels so you're notified the moment something degrades:

  1. In Vigilmon, go to Settings → Alerts.
  2. Add a Slack webhook or email alert.
  3. Set the alert threshold — 2 consecutive failures before alerting prevents spurious notifications.
  4. Apply the alert to all The Lounge monitors.

Recommended alert escalation:

  • Web UI down → immediate Slack alert
  • WebSocket endpoint down → immediate Slack alert
  • Login endpoint down → alert after 2 failures
  • Heartbeat missed → alert after 2 missed intervals
  • TLS expiry < 21 days → daily reminder

What to Watch

| Monitor | Check | Alert threshold | |---|---|---| | Web UI | HTTP 200 at / | 1 failure | | WebSocket | HTTP 200 at /socket.io/?EIO=4&transport=polling | 1 failure | | Login endpoint | HTTP 200 at /login | 2 failures | | Process heartbeat | Cron ping every 5 min | 2 missed | | TLS certificate | Expiry < 21 days | Immediate |


Conclusion

The Lounge is a reliable IRC gateway for self-hosted teams — and now you have visibility into every layer that keeps it running. Vigilmon's free tier covers all the monitors set up here. When the Node.js process crashes, WebSocket stops upgrading, or the TLS certificate silently expires, you'll know within minutes instead of finding out when users complain.

Sign up for Vigilmon free →

Monitor your app with Vigilmon

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

Start free →