YOURLS (Your Own URL Shortener) puts you in full control of your branded short links — no third-party analytics, no per-click charges, and no service outages outside your control. But that control comes with a responsibility: when YOURLS goes down, every published short link stops working. Vigilmon gives you the uptime monitoring, API health checks, and SSL certificate alerts to catch failures before your audience does.
What You'll Set Up
- HTTP monitor for the YOURLS admin interface
- API health check via the YOURLS version and db-stats endpoints
- Short link redirect verification (301/302 probe)
- SSL certificate expiry alerts for your short link domain
- Heartbeat monitor for YOURLS database health under redirect load
Prerequisites
- YOURLS installed and accessible over HTTP/HTTPS (port 80 or 443)
- A test short link slug available for redirect probing
- A YOURLS API signature token (from the admin panel under Tools → API)
- A free Vigilmon account
Step 1: Monitor the YOURLS Admin Interface
The YOURLS admin panel at /admin/ is your first health signal. A 200 response confirms that the web server (Apache or nginx) is up, PHP is executing, and the MySQL connection is established enough to render the login page.
- Log in to vigilmon.online and click Add Monitor.
- Set Type to
HTTP / HTTPS. - Enter your admin URL:
https://s.yourdomain.com/admin/ - Set Check interval to
1 minute. - Set Expected HTTP status to
200. - Under Keyword check, enter
YOURLSto confirm the page body is your admin interface, not an nginx default page. - Click Save.
This single check catches web server crashes, PHP-FPM failures, and MySQL connection errors that prevent the admin page from loading.
Step 2: Monitor the YOURLS REST API
YOURLS exposes a REST API at /yourls-api.php. The version action works without authentication, making it ideal for a lightweight liveness check:
GET https://s.yourdomain.com/yourls-api.php?action=version&format=json
Expected response:
{
"message": "1.9.2",
"simple": "1.9.2",
"verbose": "YOURLS 1.9.2",
"errorCode": "200"
}
Add this monitor in Vigilmon:
- Click Add Monitor → HTTP / HTTPS.
- URL:
https://s.yourdomain.com/yourls-api.php?action=version&format=json - Expected status:
200. - Keyword check:
errorCode— confirms the JSON response is well-formed. - Check interval:
2 minutes. - Click Save.
For a deeper check that validates the MySQL connection, use the db-stats action with your API signature:
GET https://s.yourdomain.com/yourls-api.php?action=db-stats&format=json&signature=YOUR_TOKEN
This returns total link and click counts. Add it as a second monitor with keyword check total-links to confirm the database query succeeded.
Step 3: Verify Short Link Redirects
The redirect engine is the core of YOURLS — it must serve 301/302 redirects for every published short link. Create a permanent test slug (e.g. test-ping) pointing to a stable URL, then monitor it:
- In the YOURLS admin panel, create a short link with slug
test-pingpointing tohttps://vigilmon.online. - In Vigilmon, click Add Monitor → HTTP / HTTPS.
- URL:
https://s.yourdomain.com/test-ping - Expected status:
301or302(Vigilmon allows specifying redirect status codes). - Follow redirects: disabled — you want to verify the redirect response itself, not the destination.
- Check interval:
2 minutes. - Click Save.
A failure here means the redirect engine has stalled, MySQL is not responding to queries, or the .htaccess / nginx rewrite rules have been broken by a configuration change.
Step 4: SSL Certificate Alerts for Your Short Link Domain
Branded short links rely on your custom domain with SSL. If the certificate expires, every HTTPS short link returns a browser error and your audience sees nothing useful. This is particularly damaging because old short links in tweets, emails, and documents are never updated.
Enable SSL monitoring on each YOURLS monitor:
- Open any HTTPS monitor you created above.
- Enable Monitor SSL certificate.
- Set Alert when certificate expires in less than
21 days. - Click Save.
If you use Let's Encrypt with Certbot:
# Check certificate expiry manually
certbot certificates
# Force renewal if needed
certbot renew --force-renewal
A 21-day alert window gives you three auto-renewal attempts (Certbot retries every 12 hours) before the certificate actually expires.
Step 5: Heartbeat Monitoring for YOURLS Database Health
Under redirect load, MySQL connection pool exhaustion can cause YOURLS to accept HTTP connections but fail to resolve links. A heartbeat that calls the db-stats API on a schedule detects this degraded state before users report broken links.
- In Vigilmon, click Add Monitor → Cron Heartbeat.
- Set Expected ping interval to
5 minutes. - Copy the heartbeat URL (e.g.
https://vigilmon.online/heartbeat/abc123). - Add a cron job on your YOURLS server:
crontab -e
*/5 * * * * curl -sf "https://s.yourdomain.com/yourls-api.php?action=db-stats&format=json&signature=YOUR_TOKEN" | grep -q "total-links" && curl -s https://vigilmon.online/heartbeat/abc123
This cron entry runs every 5 minutes, queries the YOURLS database stats API, and only pings the Vigilmon heartbeat if the response contains total-links. If MySQL is down or the API returns an error, the heartbeat ping is skipped and Vigilmon alerts after the interval passes.
Step 6: Configure Alert Channels
- Go to Alert Channels in Vigilmon and add email, Slack, or a webhook endpoint.
- Set Consecutive failures before alert to
2on the admin and API monitors — a single slow PHP-FPM response can cause a one-off failure that self-resolves. - Set Consecutive failures to
1on the redirect monitor — a failed redirect means live short links are broken right now.
Summary
| Monitor | URL | What It Catches |
|---|---|---|
| Admin interface | /admin/ | Web server crash, PHP failure, MySQL down |
| API version | /yourls-api.php?action=version | API layer broken, PHP syntax error |
| DB stats | /yourls-api.php?action=db-stats | MySQL connection failure |
| Redirect engine | /{test-slug} | Redirect engine stalled, rewrite rules broken |
| SSL certificate | Your short domain | Let's Encrypt renewal failure |
| Cron heartbeat | Heartbeat URL | MySQL pool exhaustion, silent DB errors |
YOURLS gives you permanent ownership of every short link you publish — but only if the server stays up. With Vigilmon watching the admin panel, API, redirect engine, SSL certificate, and database health, you get the full observability picture that keeps your branded links working around the clock.