tutorial

Monitoring phpMyAdmin with Vigilmon

phpMyAdmin is the world's most widely deployed web-based MySQL administration tool — and a high-value attack target. Here's how to monitor its availability, watch the underlying MySQL port, and get SSL alerts before credentials are exposed.

phpMyAdmin is installed on virtually every shared hosting panel (cPanel, Plesk, ISPConfig) and millions of standalone LAMP stacks worldwide. It's the de-facto standard for browser-based MySQL and MariaDB administration — but that ubiquity makes it a prime target for brute-force and SQL injection attacks, and its availability is a direct indicator of whether the underlying database server is reachable. Vigilmon lets you monitor the phpMyAdmin login page, the MySQL connectivity endpoint, the underlying TCP port, and the SSL certificate that guards database credentials in transit.

What You'll Set Up

  • HTTP monitor for the phpMyAdmin login page (/phpmyadmin/index.php or /pma/index.php)
  • HTTP monitor for the server status page (/phpmyadmin/server_status.php) confirming live MySQL connectivity
  • TCP port monitor for MySQL on port 3306
  • SSL certificate expiry alert for HTTPS phpMyAdmin deployments
  • Heartbeat monitor for MySQL Event Scheduler jobs managed through phpMyAdmin

Prerequisites

  • phpMyAdmin deployed and accessible over HTTP or HTTPS
  • MySQL or MariaDB running on the same or a remote host
  • A free Vigilmon account

Step 1: Monitor the phpMyAdmin Login Page

The phpMyAdmin login page is your first-line availability check. If it returns a non-200 status, either phpMyAdmin's PHP process is down, Apache/Nginx is failing, or the PHP-FPM pool has crashed.

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your phpMyAdmin URL. Common paths:
    • https://yourdomain.com/phpmyadmin/index.php
    • https://yourdomain.com/pma/index.php
    • https://db.yourdomain.com/ (if phpMyAdmin is the root app)
  4. Set Check interval to 1 minute.
  5. Under Keyword check, enter phpMyAdmin to verify the page content is correct and not an error page or WAF block page.
  6. Set Expected HTTP status to 200.
  7. Click Save.

A keyword check catches cases where the server returns 200 but serves a PHP fatal error page or maintenance splash — situations a status-code-only check would miss.


Step 2: Monitor the MySQL Server Status Page

phpMyAdmin includes a /phpmyadmin/server_status.php page that only loads successfully when phpMyAdmin can reach the MySQL server. Add this as a second monitor:

  1. Click Add MonitorHTTP / HTTPS.
  2. Set the URL to:
    https://yourdomain.com/phpmyadmin/server_status.php
    
  3. Add a Keyword check for Uptime — a string that appears in the MySQL server status table when the connection is live.
  4. Set Expected HTTP status to 200.
  5. Set Check interval to 5 minutes (this endpoint is more expensive than a login page ping).
  6. Click Save.

If this monitor alerts but the login page monitor is still green, MySQL connectivity has failed while the PHP layer is still up — giving you a precise failure signal to act on.


Step 3: Monitor MySQL TCP Port 3306

Add a TCP port monitor to check that MySQL is accepting connections at the network level, independent of PHP or phpMyAdmin:

  1. Click Add MonitorTCP Port.
  2. Enter your database server hostname or IP address.
  3. Set Port to 3306.
  4. Set Check interval to 1 minute.
  5. Click Save.

This monitor catches MySQL crashes, bind-address misconfigurations, and firewall rule changes that silently block database access without affecting the web server layer.

If your MySQL server is on a separate host from phpMyAdmin (a common production setup), this TCP check is especially valuable — it tells you whether the issue is in the MySQL host or in phpMyAdmin's PHP layer.


Step 4: SSL Certificate Alerts

phpMyAdmin transmits database credentials in the login form. A lapsed SSL certificate means those credentials travel in plaintext, exposing your entire database to network interception. Add certificate monitoring with enough lead time to renew before expiry:

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

A 21-day alert window is appropriate for phpMyAdmin because it's often deployed on shared hosting where automated renewal can silently fail. Twenty-one days gives enough time to diagnose the renewal failure and act manually if needed.

For phpMyAdmin deployed behind a reverse proxy (Nginx or Apache in front of a PHP container), make sure the certificate Vigilmon checks is the one on the proxy, not an internal self-signed cert. Vigilmon checks the certificate presented at the public URL.


Step 5: Heartbeat Monitoring for MySQL Event Scheduler Jobs

phpMyAdmin is often used to create and manage MySQL Event Scheduler jobs — stored procedures that run on a schedule for maintenance tasks like log cleanup, aggregation, or data archiving. These jobs run silently inside MySQL, and a crash in the Event Scheduler or a SET GLOBAL event_scheduler = OFF command can stop all scheduled jobs without any visible error.

Use Vigilmon's cron heartbeat to verify your scheduled events are running:

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set the Expected ping interval to match your event's schedule (e.g. 60 minutes for an hourly event).
  3. Copy the heartbeat URL (e.g. https://vigilmon.online/heartbeat/abc123).
  4. Modify the stored procedure or add a companion MySQL event that calls the heartbeat URL after completing its work.

Since MySQL stored procedures can't make HTTP calls natively, add a heartbeat call from an application-level wrapper or a small companion script that runs after the event:

#!/bin/bash
# Run after your MySQL event completes its cycle
# Confirm the event ran by pinging Vigilmon
mysql -u myuser -pmypassword -e "CALL verify_maintenance_complete();"
if [ $? -eq 0 ]; then
  curl -s https://vigilmon.online/heartbeat/abc123
fi

Alternatively, add an INSERT to a heartbeat_log table inside the event itself, and have a separate lightweight cron job read that table and fire the ping:

#!/bin/bash
# Check if the event logged a successful run in the last 70 minutes
RESULT=$(mysql -u monitor -pmonitorpass -e \
  "SELECT COUNT(*) FROM app.heartbeat_log WHERE created_at > NOW() - INTERVAL 70 MINUTE;" \
  --skip-column-names 2>/dev/null)

if [ "$RESULT" -gt "0" ]; then
  curl -s https://vigilmon.online/heartbeat/abc123
fi

If phpMyAdmin accidentally disables the Event Scheduler (a common side effect of certain phpMyAdmin configuration changes), Vigilmon will alert you when the heartbeat stops arriving.


Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add Slack, email, or a webhook endpoint.
  2. Set Consecutive failures before alert to 2 on the login page and server status monitors — temporary PHP-FPM restarts can cause a single probe miss.
  3. Keep the TCP port monitor at 1 consecutive failure — a MySQL port going dark is always significant.
  4. Use Maintenance windows in Vigilmon when running MySQL upgrades or phpMyAdmin upgrades to suppress false alerts:
curl -X POST https://vigilmon.online/api/maintenance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"monitor_id": "abc123", "duration_minutes": 30}'

Summary

| Monitor | Target | What It Catches | |---|---|---| | Login page | /phpmyadmin/index.php | PHP/web server failure, WAF blocks | | Server status | /phpmyadmin/server_status.php | MySQL connectivity failure | | TCP port | 3306 | MySQL crash, firewall change | | SSL certificate | phpMyAdmin HTTPS domain | Certificate expiry before credentials exposed | | Cron heartbeat | Heartbeat URL | MySQL Event Scheduler jobs silently stopped |

phpMyAdmin's role as the most widely deployed database admin UI makes its availability both operationally critical and a security concern. With Vigilmon watching the login page, the MySQL connectivity endpoint, the TCP port, and the SSL certificate, you'll know immediately when phpMyAdmin or its underlying database becomes unavailable — before your users or attackers discover it first.

Monitor your app with Vigilmon

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

Start free →