Polr is a feature-complete self-hosted URL shortener built on Laravel — giving you branded short links, per-user API keys, custom aliases, and detailed click analytics without relying on Bit.ly or TinyURL. Running your own Polr instance means owning your link data and analytics pipeline, but it also means you own the uptime. Vigilmon monitors your Polr web application, REST API, and queue workers so link creation and analytics stay healthy around the clock.
What You'll Set Up
- HTTP monitor for the Polr web application
- REST API health check via the link lookup endpoint
- Write-path heartbeat that tests database inserts end-to-end
- SSL certificate expiry alerts for your Polr domain
- Laravel queue worker health via scheduled API calls
Prerequisites
- Polr installed and accessible over HTTP/HTTPS (port 80 or 443)
- A valid Polr API key (generated in the Polr admin panel under API Settings)
- A known short link alias for lookup testing
- A free Vigilmon account
Step 1: Monitor the Polr Web Application
The Polr homepage confirms that nginx (or Apache) is serving traffic and the Laravel application has booted. A redirect to /login is normal for private-mode Polr — add a keyword check rather than relying solely on status code.
- Log in to vigilmon.online and click Add Monitor.
- Set Type to
HTTP / HTTPS. - Enter your Polr URL:
https://s.yourdomain.com/ - Set Check interval to
1 minute. - Set Expected HTTP status to
200(or302if you expect a login redirect — Vigilmon lets you specify either). - Under Keyword check, enter
Polrto confirm the response body is your application, not an nginx default page. - Click Save.
If Polr returns a 500 error (common when the .env is misconfigured or the database is unreachable), Vigilmon alerts immediately.
Step 2: Monitor the Polr REST API
Polr's REST API lives at /api/v2/. The link lookup endpoint validates a short alias and returns the destination URL — a perfect health check that exercises both the API layer and the database query path:
GET https://s.yourdomain.com/api/v2/links/lookup?url_ending={your-test-alias}&key={api-key}
Expected response:
{
"action": "lookup",
"result": "https://example.com/your-long-url"
}
Add this as a monitor in Vigilmon:
- Click Add Monitor → HTTP / HTTPS.
- URL:
https://s.yourdomain.com/api/v2/links/lookup?url_ending=test&key=YOUR_API_KEY(replacetestwith an alias you created in Polr) - Expected status:
200. - Keyword check:
result— confirms the JSON contains a resolved URL. - Check interval:
2 minutes. - Click Save.
If the API key is revoked or the database is down, the response body will contain error instead of result, triggering the keyword mismatch alert.
Step 3: Monitor the Polr Write Path
Read-path API calls can succeed even when the database write path is degraded. To validate that Polr can create new short links (the core operation), use a scheduled POST to create a private test link:
POST https://s.yourdomain.com/api/v2/links?key={api_key}&url=https://vigilmon.online&is_secret=1
Expected response:
{
"action": "shorten",
"result": "https://s.yourdomain.com/abc123"
}
In Vigilmon:
- Click Add Monitor → Cron Heartbeat.
- Set Expected ping interval to
10 minutes. - Copy the heartbeat URL.
- On your server, create a script that posts a test link and pings the heartbeat only on success:
#!/bin/bash
RESPONSE=$(curl -sf -X POST \
"https://s.yourdomain.com/api/v2/links?key=YOUR_API_KEY&url=https%3A%2F%2Fvigilmon.online&is_secret=1")
if echo "$RESPONSE" | grep -q '"action":"shorten"'; then
curl -s https://vigilmon.online/heartbeat/abc123
fi
Schedule it every 10 minutes:
*/10 * * * * /opt/polr-healthcheck.sh
This catches write failures that read-only API checks miss — such as a full disk, a locked MySQL table, or an exhausted database connection pool.
Cleanup: Private (secret) links are not indexed publicly, but periodically delete test links via the Polr admin panel or the API to keep the link count tidy.
Step 4: SSL Certificate Alerts for Your Polr Domain
Polr is typically deployed with a Let's Encrypt certificate behind nginx. Auto-renewal can silently fail if port 80 is firewalled, the webroot path is wrong, or the renewal cron is missing.
Enable SSL monitoring on your Polr HTTP monitor:
- Open the monitor created in Step 1.
- Enable Monitor SSL certificate.
- Set Alert when certificate expires in less than
21 days. - Click Save.
Check Certbot renewal status manually:
certbot certificates
# shows expiry dates
certbot renew --dry-run
# tests renewal without making changes
If renewal fails, force it:
certbot renew --force-renewal
systemctl reload nginx
Step 5: Verify the Laravel Queue Worker
Polr processes click analytics asynchronously using Laravel queues. If the queue worker (php artisan queue:work) stops, clicks are still recorded in the database but the analytics processing pipeline stalls. The queue backlog grows until the worker restarts.
To verify the queue worker is processing jobs, check the queue table in MySQL:
# Count pending jobs — should stay near zero in healthy operation
mysql -u polr -p polr_db -e "SELECT COUNT(*) FROM jobs;"
Alternatively, monitor the queue depth with a Vigilmon heartbeat:
- Create a Cron Heartbeat with a 5-minute expected interval.
- On the server, run a check that pings only when the queue is draining:
#!/bin/bash
PENDING=$(mysql -u polr -p"$DB_PASS" polr_db -se "SELECT COUNT(*) FROM jobs;")
if [ "$PENDING" -lt 100 ]; then
curl -s https://vigilmon.online/heartbeat/queue-abc123
fi
If the queue exceeds 100 pending jobs, the heartbeat is skipped and Vigilmon alerts after 5 minutes — indicating the worker has stopped.
Step 6: Configure Alert Channels
- Go to Alert Channels in Vigilmon and add email, Slack, or webhook notification channels.
- Set Consecutive failures before alert to
2on the web application monitor — Laravel's boot sequence can occasionally cause a single slow response. - Set Consecutive failures to
1on the write-path heartbeat — a failed link creation means the core Polr function is broken.
Summary
| Monitor | Target | What It Catches |
|---|---|---|
| Web application | / | nginx down, Laravel boot failure |
| API lookup | /api/v2/links/lookup | API broken, database read failure |
| Write-path heartbeat | POST /api/v2/links | Database write failure, disk full |
| SSL certificate | Your short domain | Let's Encrypt renewal failure |
| Queue worker heartbeat | MySQL jobs table | Queue worker stopped, analytics stalled |
Polr gives you a modern, multi-user URL shortener with analytics you fully own. With Vigilmon monitoring the web UI, API, write path, SSL, and queue worker, you catch the full range of failure modes — from a downed web server to a silently stalled analytics pipeline.