tutorial

Monitoring MediaWiki with Vigilmon

MediaWiki powers Wikipedia and thousands of enterprise wikis — but it ships with no built-in uptime monitoring. Here's how to monitor your MediaWiki instance, its API endpoints, SSL certificates, and maintenance job heartbeats with Vigilmon.

MediaWiki is the world's most widely deployed open-source wiki platform (PHP, MySQL/MariaDB), powering Wikipedia, Wikimedia Commons, and thousands of corporate intranets and documentation sites. When your MediaWiki instance goes down, every editor and reader loses access to your organisation's knowledge base. Vigilmon keeps watch around the clock — alerting you the moment the wiki UI, its API, SSL certificates, or background maintenance jobs show signs of trouble.

What You'll Set Up

  • HTTP uptime monitor for the MediaWiki Main Page (web UI health check)
  • API endpoint monitors for /api.php (Action API) and /api/rest_v1/ (REST API)
  • SSL certificate expiry alerts for HTTPS MediaWiki deployments
  • Cron heartbeat monitors for MediaWiki maintenance scripts (runJobs.php, updateSearchIndex.php)

Prerequisites

  • MediaWiki 1.35+ (LTS) running on a server accessible over HTTP or HTTPS
  • PHP-CLI available on the server (required for maintenance scripts)
  • A free Vigilmon account

Step 1: Monitor the MediaWiki Main Page

The Main Page is the canonical health indicator for a MediaWiki install. A successful response confirms PHP is running, the database is reachable, and MediaWiki's core rendering pipeline is intact.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your wiki's Main Page URL:
    https://wiki.yourdomain.com/wiki/Main_Page
    
    Or, if you use short URLs:
    https://wiki.yourdomain.com/
    
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. In Keyword check, enter a phrase from your Main Page that should always be present — for example, MediaWiki or your wiki's name. This catches cases where the page loads with an error message rather than real content.
  7. Click Save.

Step 2: Monitor the MediaWiki Action API

MediaWiki's Action API (/api.php) is used by bots, extensions, mobile apps, and integrations. Monitoring it separately from the UI catches failures in the API layer while the wiki frontend still serves cached pages.

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter the siteinfo endpoint:
    https://wiki.yourdomain.com/api.php?action=query&meta=siteinfo&format=json
    
  3. Set Check interval to 5 minutes.
  4. Set Expected HTTP status to 200.
  5. In Keyword check, enter generator — this key always appears in a healthy siteinfo response and confirms the API returned valid JSON.
  6. Click Save.

This monitor alerts you if the Action API is returning errors or is unreachable, independently of whether the wiki frontend appears healthy.


Step 3: Monitor the MediaWiki REST API

MediaWiki 1.35+ ships a REST API under /api/rest_v1/. It serves page summaries, revisions, and media metadata and is used by many modern integrations. Add a monitor for the page summary endpoint:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter the REST API page summary endpoint for a page that always exists on your wiki (substitute Main_Page with the actual title if different):
    https://wiki.yourdomain.com/api/rest_v1/page/summary/Main_Page
    
  3. Set Check interval to 5 minutes.
  4. Set Expected HTTP status to 200.
  5. In Keyword check, enter title — present in every valid summary response.
  6. Click Save.

Step 4: SSL Certificate Alerts

Let's Encrypt and other CAs issue short-lived certificates. A missed renewal causes your wiki to show browser security warnings to every visitor. Add a certificate expiry alert to each HTTPS monitor:

  1. Open any of the monitors you created above.
  2. Enable Monitor SSL certificate under the SSL section.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

Repeat for every hostname your wiki is reachable under (e.g., wiki.yourdomain.com, www.yourdomain.com). A 21-day window gives you three weekly renewal attempts before the certificate actually expires.

To verify your current certificate expiry from the command line:

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

Step 5: Heartbeat Monitoring for MediaWiki Maintenance Scripts

MediaWiki's job queue and search index rely on PHP CLI maintenance scripts, typically invoked by cron. If the cron entry is misconfigured, the server runs out of disk space, or PHP crashes silently, jobs pile up — and the wiki degrades without any HTTP-level sign of failure.

Use Vigilmon's cron heartbeat to confirm each maintenance script actually completes.

runJobs.php (Job Queue Runner)

MediaWiki defers expensive operations (notifications, re-renders, file processing) to the job queue. runJobs.php drains the queue and should run frequently — every minute on busy wikis.

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set the name to MediaWiki runJobs.
  3. Set Expected ping interval to 5 minutes (or match your cron frequency).
  4. Copy the heartbeat URL (e.g., https://vigilmon.online/heartbeat/abc123).
  5. Update your cron entry to ping Vigilmon on success:
# /etc/cron.d/mediawiki-runjobs
* * * * * www-data php /var/www/mediawiki/maintenance/runJobs.php --maxjobs=100 \
  && curl -s https://vigilmon.online/heartbeat/abc123

updateSearchIndex.php (Search Index Rebuilder)

If your wiki uses CirrusSearch, MWSearch, or the built-in SQLite search, the index must stay current for search to work.

  1. Click Add MonitorCron Heartbeat.
  2. Set the name to MediaWiki updateSearchIndex.
  3. Set Expected ping interval to match your cron schedule (e.g., 60 minutes).
  4. Update your cron entry:
# /etc/cron.d/mediawiki-searchindex
0 * * * * www-data php /var/www/mediawiki/maintenance/updateSearchIndex.php \
  && curl -s https://vigilmon.online/heartbeat/def456

If either script crashes mid-run or is skipped entirely, Vigilmon alerts you after the expected interval passes.


Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add Slack, email, or a webhook to your preferred notification destination.
  2. Set Consecutive failures before alert to 2 on the web UI monitor — a single slow PHP response can cause one probe to time out without indicating a real outage.
  3. Use Maintenance windows in Vigilmon when running major MediaWiki upgrades or database maintenance:
# Suppress alerts for 30 minutes during an upgrade
curl -X POST https://vigilmon.online/api/maintenance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"monitor_id": "YOUR_MONITOR_ID", "duration_minutes": 30}'

Summary

| Monitor | Target | What It Catches | |---|---|---| | Main Page | https://wiki.yourdomain.com/wiki/Main_Page | PHP crash, DB down, rendering failure | | Action API | /api.php?action=query&meta=siteinfo | API layer failure | | REST API | /api/rest_v1/page/summary/Main_Page | REST API unavailable | | SSL certificate | Each HTTPS hostname | Certificate expiry | | runJobs heartbeat | Heartbeat URL | Job queue backlog, cron failure | | updateSearchIndex heartbeat | Heartbeat URL | Stale search index, cron failure |

MediaWiki is battle-tested at Wikipedia scale — but your instance still needs active monitoring. With Vigilmon watching the wiki UI, API endpoints, SSL certificates, and maintenance scripts, you'll know about problems before your editors do.

Monitor your app with Vigilmon

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

Start free →