tutorial

Monitoring MantisBT with Vigilmon

MantisBT has tracked bugs for 20+ years across software teams and scientific projects — but a silent database failure or missed cron job means bug notifications stop and the tracker goes dark. Here's how to monitor MantisBT end-to-end with Vigilmon.

MantisBT (Mantis Bug Tracker) is one of the most mature open-source bug tracking systems available, with over 20 years in production use across software development teams, scientific research projects, and IT organizations worldwide. Built on PHP with a MySQL or PostgreSQL backend, it's lightweight and self-hosted. But that self-hosted nature means you're responsible for knowing when the tracker goes down, when the database fails, or when the scheduled reminder email cron stops firing. Vigilmon gives you that visibility without any changes to MantisBT itself.

What You'll Set Up

  • HTTP uptime monitor for the MantisBT web UI (login page)
  • REST API monitor for /api/rest/v1/ endpoint (project list health check)
  • Database connectivity check via HTTP response keyword
  • SSL certificate expiry alerts for HTTPS MantisBT installations
  • Heartbeat monitor for MantisBT reminder email cron tasks (bug notification delivery)

Prerequisites

  • MantisBT 2.x or later installed and accessible over HTTP or HTTPS
  • MantisBT API token (generated in My Account → API Tokens)
  • SSH access to configure cron jobs
  • A free Vigilmon account

Step 1: Monitor the MantisBT Web UI

The MantisBT login page is the entry point for all users. If it fails, developers cannot report bugs, managers cannot review the tracker, and the entire team loses visibility into active issues.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your MantisBT URL: https://bugs.yourdomain.com/login_page.php
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Enable Keyword match and enter: MantisBT
  7. Click Save.

MantisBT's login page includes "MantisBT" in the page title and header. The keyword match distinguishes a genuine MantisBT response from a web server error page that returns HTTP 200 with HTML error content.


Step 2: Monitor the MantisBT REST API

MantisBT 2.21+ ships with a REST API at /api/rest/v1/. The project list endpoint is an ideal health check: it requires a valid API token, a working database connection, and successful query execution.

  1. Click Add Monitor in Vigilmon.
  2. Set Type to HTTP / HTTPS.
  3. Enter the API URL: https://bugs.yourdomain.com/api/rest/v1/projects
  4. Add a custom request header:
    • Header name: Authorization
    • Header value: Bearer YOUR_MANTISBT_API_TOKEN
  5. Set Expected HTTP status to 200.
  6. Enable Keyword match and enter: projects
  7. Set Check interval to 5 minutes.
  8. Click Save.

A 200 response with a projects JSON key confirms that the REST API, PHP, and database are all operational. A 401 means the API token has been revoked or expired; a 500 indicates a PHP or database error.

To generate an API token:

  1. Log in to MantisBT as an administrator.
  2. Go to My AccountAPI Tokens.
  3. Click Create API Token, name it vigilmon-monitor, and copy the token.

Step 3: Check Database Connectivity via Keyword Match

MantisBT's login page only renders fully when the database connection succeeds. A database failure causes MantisBT to display an error message — which may still return HTTP 200.

Add a negative keyword check to detect this silent failure:

  1. Open the web UI monitor from Step 1.
  2. Add a second Keyword match rule:
    • Keyword: APPLICATION ERROR
    • Match type: Must NOT contain
  3. Click Save.

MantisBT displays APPLICATION ERROR #1500 when the database connection fails. This keyword check will fire an alert if that error string appears in the page — regardless of the HTTP status code.

Additionally, use the REST API monitor's response keyword check (from Step 2) as your primary database health indicator, since the API always returns JSON and any database error produces a 500 with an error body rather than a 200.


Step 4: SSL Certificate Alerts

MantisBT bug trackers often contain sensitive project information and internal technical details. An expired SSL certificate exposes this data to man-in-the-middle risks and forces developers to click through browser warnings — or disable HTTPS entirely as a workaround.

Enable SSL monitoring on your web UI monitor:

  1. Open the monitor from Step 1.
  2. Under SSL Certificate, enable Monitor certificate expiry.
  3. Set Alert threshold to 21 days before expiry.
  4. Click Save.

Check your certificate expiry at any time:

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

If you're using Let's Encrypt with certbot:

sudo certbot certificates
sudo certbot renew --dry-run

For MantisBT instances behind a load balancer or reverse proxy, monitor the public domain to check the certificate that end users actually receive — not the internal backend IP.


Step 5: Heartbeat Monitoring for MantisBT Email Notifications

MantisBT sends bug update notifications, reminder emails, and escalation alerts via a combination of immediate SMTP sends and scheduled cron jobs. The key cron script is scripts/send_emails.php, which processes the email queue.

If this script fails — due to PHP errors, SMTP configuration changes, or file permission issues — the email queue backs up silently. Developers stop receiving bug assignment emails; managers miss escalation alerts; the tracker appears alive but notifications are dead.

Set up a Vigilmon heartbeat:

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Name it MantisBT Email Queue.
  3. Set Expected ping interval to 10 minutes (or match your cron schedule).
  4. Copy the heartbeat URL (e.g. https://vigilmon.online/heartbeat/abc123).

Add the heartbeat to your crontab:

crontab -e

Add the following (adjust the path to your MantisBT installation):

*/10 * * * * php /var/www/mantisbt/scripts/send_emails.php && curl -s https://vigilmon.online/heartbeat/abc123

The && ensures the heartbeat fires only on clean exit. A PHP fatal error, SMTP failure, or permission error prevents the heartbeat from sending, and Vigilmon alerts after 10 minutes.

For complete visibility into the email queue, also monitor MantisBT's reminder cron:

*/30 * * * * php /var/www/mantisbt/scripts/reminder_send.php && curl -s https://vigilmon.online/heartbeat/def456

Create a second Vigilmon heartbeat for this with a 30-minute interval.


Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and configure your notification destinations: email, Slack, PagerDuty, or a webhook.
  2. Set Consecutive failures before alert to 2 on the web UI monitor — MantisBT occasionally takes 10–15 seconds to restart PHP-FPM on shared hosting, causing isolated probe failures.
  3. Set Consecutive failures to 1 on the REST API monitor — an API failure that persists across two 5-minute intervals (10 minutes total) is always a real outage.
  4. For heartbeat monitors, alert on the first missed ping — a missed email queue cron is never a transient issue.

Suppress alerts during MantisBT upgrades or database migrations:

# Before upgrading MantisBT
curl -X POST https://vigilmon.online/api/maintenance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"monitor_id": "abc123", "duration_minutes": 30}'

# Perform upgrade
php /var/www/mantisbt/admin/install.php

# Maintenance window expires automatically

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web UI | https://bugs.domain.com/login_page.php | PHP down, nginx/Apache failure | | DB keyword | APPLICATION ERROR absent from page | Database connection failure | | REST API | /api/rest/v1/projects + API token | API layer broken, DB unreachable | | SSL certificate | Bug tracker domain | Certificate expiry, renewal failure | | Email queue heartbeat | Heartbeat URL every 10 min | Notification emails stopped | | Reminder cron heartbeat | Heartbeat URL every 30 min | Scheduled reminders not sending |

MantisBT has earned its longevity through reliability — but that reliability isn't self-monitoring. With Vigilmon watching the web UI, REST API, database connectivity, SSL certificate, and email notification crons, your bug tracker is covered end-to-end. Your team will know about issues before they do.

Monitor your app with Vigilmon

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

Start free →