Moodle is the world's most widely used open-source Learning Management System, powering courses for over 400 million users across universities, schools, and corporate training platforms. When Moodle goes down during an exam window or a major assignment deadline, the consequences are immediate and visible. Vigilmon gives you continuous uptime monitoring for your Moodle homepage, login page, admin health endpoint, SSL certificates, and the scheduled cron tasks that drive course completion, grade synchronization, and backups.
What You'll Set Up
- HTTP uptime monitor for the Moodle homepage
- Login page health check to confirm authentication is functional
- Admin health check endpoint monitoring (
/admin/tool/health/) - SSL certificate expiry alerts for your Moodle domain
- Heartbeat monitoring for Moodle's scheduled cron tasks (course completion, grade sync, backup)
Prerequisites
- Moodle 3.9+ installed and accessible over HTTP/HTTPS
- Admin access to configure Moodle's cron and health tools
- A free Vigilmon account
Step 1: Monitor the Moodle Homepage
The Moodle homepage is the first thing learners see, and its availability confirms that your web server, PHP-FPM, and database connection are all functional.
- Log in to vigilmon.online and click Add Monitor.
- Set Type to
HTTP / HTTPS. - Enter your Moodle URL:
https://moodle.yourdomain.com(orhttp://if you haven't enabled HTTPS yet). - Set Check interval to
1 minute. - Set Expected HTTP status to
200. - Click Save.
Optionally, add a keyword check to confirm actual Moodle content is served rather than a generic web server error page:
- Enable Keyword check on the same monitor.
- Enter a phrase that appears on your Moodle homepage, such as
Log inor your site name. - Set the monitor to alert when the keyword is absent.
This catches cases where the web server returns 200 with an error page (e.g., a PHP fatal error that outputs some HTML before dying).
Step 2: Monitor the Login Page
The login page (/login/index.php) requires PHP session handling, database connectivity, and Moodle's authentication plugins. It can fail independently of the homepage if the session store (Redis, Memcached, or filesystem) has a problem.
- In Vigilmon, click Add Monitor → HTTP / HTTPS.
- Set the URL to:
https://moodle.yourdomain.com/login/index.php - Set Expected HTTP status to
200. - Enable Keyword check and enter
UsernameorLog in— text that only appears on a functioning login form. - Set Check interval to
1 minute. - Click Save.
A login page monitor that fires independently of the homepage monitor helps you distinguish between a full outage (both fail) and an authentication-layer problem (login fails while the homepage serves a cached response).
Step 3: Use the Moodle Admin Health Check Endpoint
Moodle ships with a built-in health check tool at /admin/tool/health/ that checks internal subsystems including database connectivity, file permissions, cron status, and plugin integrity. This endpoint requires authentication, but you can configure a dedicated monitoring token.
For unauthenticated health probing, Moodle's CLI health check is more practical from a server-side monitoring script:
# Run Moodle's built-in checks from the CLI
php /var/www/moodle/admin/tool/health/cli/health.php
echo $? # 0 = healthy, non-zero = issues found
Wrap this in a small health endpoint script served by your web server:
<?php
// /var/www/html/moodle-health.php — accessible only from monitoring IPs
$output = shell_exec('php /var/www/moodle/admin/tool/health/cli/health.php 2>&1');
if (strpos($output, 'No problems found') !== false) {
http_response_code(200);
echo json_encode(['status' => 'ok']);
} else {
http_response_code(503);
echo json_encode(['status' => 'degraded', 'output' => $output]);
}
Then add a Vigilmon monitor for this endpoint:
- In Vigilmon, click Add Monitor → HTTP / HTTPS.
- Set the URL to:
https://moodle.yourdomain.com/moodle-health.php - Set Expected HTTP status to
200. - Enable Keyword check and enter
"status":"ok". - Set Check interval to
5 minutes. - Click Save.
Restrict this file to your monitoring IP range in your nginx or Apache config to prevent it from being a public information disclosure endpoint.
Step 4: SSL Certificate Alerts
Moodle deployments nearly always run on HTTPS — learner data and authentication credentials must be protected. A Let's Encrypt certificate expiry during a term can lock every student out of their courses.
- Open the HTTPS monitor created in Step 1.
- Enable Monitor SSL certificate under the SSL section.
- Set Alert when certificate expires in less than
21 days. - Click Save.
If you use Let's Encrypt with certbot, verify that auto-renewal is working:
# Check renewal status
sudo certbot renew --dry-run
# View certificate expiry
sudo certbot certificates
Common renewal failures on Moodle servers:
- Port 80 blocked by a firewall rule (HTTP challenge fails)
- Certbot cron not running after a server reboot
- Moodle's
.htaccessor nginx config redirecting the ACME challenge path
The 21-day window gives you time to investigate and manually renew before expiry:
sudo certbot renew --force-renewal
sudo systemctl reload nginx # or apache2
Step 5: Heartbeat Monitoring for Moodle Cron Tasks
Moodle's cron system is critical to LMS operation. Course completion checks, grade synchronization, email notifications, scheduled backups, and activity completion events all run through admin/cli/cron.php. A silent cron failure means grades don't sync, completion certificates don't issue, and backup files go stale.
- In Vigilmon, click Add Monitor → Cron Heartbeat.
- Set the expected ping interval to match your Moodle cron schedule (e.g.,
1minute for the standard recommended interval, or60minutes if you run it hourly). - Copy the heartbeat URL (e.g.,
https://vigilmon.online/heartbeat/abc123). - Modify your cron entry to ping Vigilmon after each successful run:
# Edit the cron job (as the web server user)
sudo crontab -u www-data -e
# Standard Moodle cron entry with Vigilmon heartbeat
* * * * * /usr/bin/php /var/www/moodle/admin/cli/cron.php > /dev/null 2>&1 && curl -s https://vigilmon.online/heartbeat/abc123
The && ensures Vigilmon is only pinged when the cron script exits with status 0 (success). A PHP fatal error during cron execution suppresses the heartbeat ping, alerting you to the failure.
For high-traffic Moodle instances that use the admin/cli/scheduled_task.php runner for individual tasks, create separate heartbeat monitors per critical task:
# Grade sync heartbeat
* * * * * /usr/bin/php /var/www/moodle/admin/cli/scheduled_task.php --execute='\core\task\grade_cron_task' > /dev/null 2>&1 && curl -s https://vigilmon.online/heartbeat/grade-abc123
# Backup heartbeat (daily at 1 AM)
0 1 * * * /usr/bin/php /var/www/moodle/admin/cli/scheduled_task.php --execute='\core\task\automated_backup_task' > /dev/null 2>&1 && curl -s https://vigilmon.online/heartbeat/backup-abc123
Step 6: Configure Alert Channels
- Go to Alert Channels in Vigilmon and add Slack, email, or a webhook.
- For the homepage and login monitors, set Consecutive failures before alert to
2— PHP-FPM process recycling can cause a single probe to fail during high load. - For the cron heartbeat monitor, consider setting up a separate high-priority alert channel (e.g., SMS or PagerDuty) — a missed cron means grade data isn't updating for every learner on your platform.
- Use Maintenance windows in Vigilmon during Moodle version upgrades:
# Create a maintenance window before upgrading
curl -X POST https://vigilmon.online/api/maintenance \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"monitor_id": "abc123", "duration_minutes": 30}'
# Run Moodle upgrade
sudo -u www-data php /var/www/moodle/admin/cli/upgrade.php --non-interactive
# Maintenance window expires automatically
Summary
| Monitor | Target | What It Catches |
|---|---|---|
| Homepage uptime | https://moodle.yourdomain.com | Web server, PHP, DB connection failure |
| Login page | /login/index.php | Session store, auth plugin failure |
| Admin health check | /moodle-health.php | Internal subsystem degradation |
| SSL certificate | Moodle domain | Let's Encrypt renewal failure |
| Cron heartbeat | Heartbeat URL | Cron failure, PHP errors in scheduled tasks |
Moodle running on your own infrastructure gives you control over data, costs, and customization — but 400 million users worth of LMS experience means your learners expect commercial-grade reliability. With Vigilmon monitoring every layer from the homepage to cron tasks, you'll know about problems before your learners do.