tutorial

Monitoring Ralph ITAM with Vigilmon

Ralph is Allegro's open-source IT asset management and DCIM system — but silent Celery worker failures can leave your asset database stale. Here's how to monitor Ralph's web UI, REST API, database connectivity, SSL certificates, and Celery task workers with Vigilmon.

Ralph is an open-source IT asset management (ITAM) and Data Center Infrastructure Management (DCIM) system developed and open-sourced by Allegro, Poland's largest e-commerce platform. Built on Python/Django, Ralph tracks physical hardware, virtual machines, data center racks, and software licenses. When Ralph's web UI goes down or its Celery workers stop processing, your asset inventory stops updating and your DCIM data becomes unreliable. Vigilmon gives you real-time uptime monitoring, REST API health checks, SSL certificate alerts, and heartbeat monitoring for Ralph's Celery-powered background tasks.

What You'll Set Up

  • HTTP uptime monitor for the Ralph web UI login page
  • REST API endpoint health check (/api/data-center/data-centers/) with token auth
  • Database connectivity verification via HTTP keyword check
  • SSL certificate expiry alerts for HTTPS Ralph setups
  • Cron heartbeat for Ralph Celery workers (asset discovery, report generation)

Prerequisites

  • Ralph installed and accessible over HTTP or HTTPS (Docker or bare-metal)
  • A Ralph API token for REST API monitoring (Step 2)
  • A free Vigilmon account

Step 1: Monitor the Ralph Web UI

Ralph's login page is the simplest availability signal. If it goes down, your entire ITAM and DCIM workflow is inaccessible.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Ralph URL:
    https://ralph.yourdomain.com/
    
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Enable Keyword Check and enter Ralph to confirm the page content is correct.
  7. Click Save.

The keyword check catches Django 500 errors that serve an error page with HTTP 200 status — which can happen when Ralph's database or cache backend becomes unavailable.


Step 2: Monitor the Ralph REST API with Token Auth

Ralph exposes a comprehensive REST API. The /api/data-center/data-centers/ endpoint is a reliable health check — it requires authentication and returns a list of defined data centers.

Generate a Ralph API Token

  1. Log in to Ralph and navigate to Admin → Auth Token.
  2. Create or copy an existing API token for a read-only service account.

Add the API Monitor in Vigilmon

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter:
    https://ralph.yourdomain.com/api/data-center/data-centers/
    
  3. Set Check interval to 5 minutes.
  4. Set Expected HTTP status to 200.
  5. Add a Custom Header:
    Authorization: Token YOUR_RALPH_API_TOKEN
    
  6. Enable Keyword Check and enter count (the API returns {"count":...,"results":[...]} on success).
  7. Click Save.

Without the token header, Ralph returns HTTP 403. The 403-vs-200 distinction confirms both that the API is reachable and that your service account credentials are still valid.


Step 3: Verify Database Connectivity via HTTP Keyword Check

Ralph uses PostgreSQL as its primary database. A Django application can sometimes return a partially rendered page or a database error page with HTTP 200 when PostgreSQL is unavailable.

  1. Open the web UI monitor from Step 1.
  2. Expand Keyword Check.
  3. Set the keyword to Ralph and enable Keyword must be present mode.
  4. Save.

If PostgreSQL goes down, Django renders a database error template. The keyword Ralph disappears from the response body, triggering a Vigilmon alert immediately — no database-level access required.


Step 4: SSL Certificate Alerts for HTTPS Ralph Setups

Ralph often sits behind an nginx reverse proxy with a Let's Encrypt certificate. ITAM systems handle internal infrastructure data, so certificate expiry can block your entire ops team.

  1. Open the Ralph web UI monitor.
  2. Enable Monitor SSL certificate under the SSL section.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

Verify your current certificate status:

echo | openssl s_client -connect ralph.yourdomain.com:443 -servername ralph.yourdomain.com 2>/dev/null \
  | openssl x509 -noout -dates

For Docker-based Ralph deployments, make sure your nginx container's certificate renewal cron (or certbot timer) is also monitored. A Vigilmon heartbeat on the certbot renewal job is a good secondary check.


Step 5: Heartbeat Monitoring for Ralph Celery Workers

Ralph uses Celery for background task processing: automated asset discovery, scheduled report generation, and data synchronization jobs. If Celery workers crash or stop, these jobs queue up silently and Ralph's data goes stale.

Set Up the Heartbeat Monitor

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set Expected ping interval to match your Celery task schedule (e.g. 60 minutes for hourly asset discovery).
  3. Copy the heartbeat URL (e.g. https://vigilmon.online/heartbeat/abc123).

Wire It Into a Ralph Celery Periodic Task

Ralph uses django-celery-beat for scheduled tasks. Add a heartbeat ping task to your Ralph configuration:

# In your Ralph celery beat schedule or tasks.py
from celery import shared_task
import requests

@shared_task
def ping_vigilmon_heartbeat():
    requests.get('https://vigilmon.online/heartbeat/abc123', timeout=5)

Register it in CELERYBEAT_SCHEDULE:

CELERYBEAT_SCHEDULE = {
    'ping-vigilmon': {
        'task': 'ralph.tasks.ping_vigilmon_heartbeat',
        'schedule': 3600.0,  # every hour
    },
}

Alternatively, for Ralph setups using system cron to trigger Celery tasks:

0 * * * * /opt/ralph/bin/ralph celery call ralph.tasks.run_discovery && curl -s https://vigilmon.online/heartbeat/abc123

If the Celery worker process crashes, the broker queue grows but no tasks execute — and no heartbeat ping is sent. Vigilmon alerts after 60 minutes with no ping.

Check Celery Worker Health Directly

You can also confirm Celery workers are alive by querying the Flower dashboard (if deployed) or the Ralph management command:

/opt/ralph/bin/ralph celery inspect ping

If this returns no responses, your workers are down.


Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add email, Slack, PagerDuty, or a webhook.
  2. Set Consecutive failures before alert to 2 on the web UI monitor — Ralph restarts and container health-check delays can cause single-probe failures.
  3. Set a stricter threshold (1 failure) on the API monitor — authentication failures or API errors rarely self-heal and warrant immediate investigation.
  4. Use Maintenance windows during Ralph version upgrades or database migrations.

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web UI | / (login page) | Application down, Django errors | | Keyword check | Ralph on login page | PostgreSQL connection failure | | REST API (auth) | /api/data-center/data-centers/ | API stack failure, auth expiry | | SSL certificate | Your Ralph domain | Certificate expiry | | Celery heartbeat | Heartbeat URL | Worker crash, missed asset discovery |

Ralph is your single source of truth for IT assets and data center infrastructure. When its web UI goes dark or its Celery workers stop running, your ops team loses visibility into hardware inventory, rack utilization, and lifecycle status. With Vigilmon monitoring Ralph's web UI, authenticated REST API, database connectivity signal, SSL certificate, and Celery worker heartbeats, you get the same observability posture that enterprise ITAM vendors charge licensing fees for — on your own infrastructure.

Monitor your app with Vigilmon

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

Start free →