Snappaste is an open-source paste service built for speed and developer use — syntax highlighting, expiry controls, visibility options, and a clean API. When you self-host it, you own the uptime. A crashed web process, a full database, or a stalled cleanup job can silently break the paste workflow your team depends on. Vigilmon gives you HTTP uptime monitoring, database health checks, TLS certificate alerts, and cron heartbeats so nothing fails quietly.
What You'll Set Up
- HTTP uptime monitor for the Snappaste web interface
- Paste creation and retrieval endpoint health checks
- Database connectivity probe (MySQL or PostgreSQL)
- Scheduled cleanup job heartbeat
- SSL/TLS certificate expiry alert
Prerequisites
- Snappaste running and accessible over HTTP/HTTPS (default port 80 or 443)
- MySQL or PostgreSQL database backing the instance
- A free Vigilmon account
Step 1: Monitor the Snappaste Web Interface
The web server is the outermost layer — if nginx, Apache, or the PHP-FPM process serving Snappaste dies, every paste operation fails.
- Log in to vigilmon.online and click Add Monitor.
- Set Type to
HTTP / HTTPS. - Enter your Snappaste URL:
https://paste.yourdomain.com. - Set Check interval to
1 minute. - Set Expected HTTP status to
200. - Click Save.
If Snappaste exposes a dedicated health route (/health or /ping), use that instead of the root path — it typically checks the database connection too, giving a richer signal.
Step 2: Monitor the Paste Creation Endpoint
The paste creation endpoint (POST /) is the core write path. A response time spike here means users are sitting at a loading spinner while trying to share code.
Add a second monitor:
- Click Add Monitor →
HTTP / HTTPS. - URL:
https://paste.yourdomain.com(or/api/v1/pasteif you're on a build with a REST API). - Set Method to
POSTand add a minimal form body:
content=healthcheck&expiry=1h&visibility=private
- Set Expected HTTP status to
200or302(redirect to the created paste). - Set Check interval to
5 minutes. - Click Save.
A sustained rise in response time (200 ms → 2 000 ms) often signals the database connection pool is exhausted before any hard failure appears.
Step 3: Monitor the Paste Retrieval Endpoint
Write health is distinct from read health. Probe a known-good paste URL to confirm retrieval is working:
- Create a permanent paste in your Snappaste instance that you will use as a canary (mark it as never-expiring if the feature is available).
- Add a Vigilmon HTTP monitor pointing at that paste's URL:
https://paste.yourdomain.com/abc123. - Set Expected HTTP status to
200. - Set Check interval to
5 minutes.
If syntax highlighting is handled server-side, the rendered HTML for this paste will confirm the highlighting pipeline is also intact.
Step 4: Database Connectivity
Snappaste stores all paste content and metadata in a relational database. A database outage means pastes cannot be created, retrieved, or listed.
Add a TCP port monitor to confirm the database process is accepting connections:
MySQL:
- Click Add Monitor → TCP Port.
- Host: your database server IP or hostname.
- Port:
3306. - Check interval:
1 minute. - Click Save.
PostgreSQL:
Same steps, port 5432.
For a deeper probe, add a health check endpoint to your Snappaste instance that queries the database:
// health.php (drop in your Snappaste public/ directory)
<?php
$pdo = new PDO(getenv('DB_DSN'), getenv('DB_USER'), getenv('DB_PASS'));
$pdo->query('SELECT 1');
echo json_encode(['status' => 'ok']);
Point a Vigilmon HTTP monitor at https://paste.yourdomain.com/health.php and set Expected body contains to "ok".
Step 5: Paste Expiry and Cleanup Job Heartbeat
Snappaste automatically deletes expired pastes via a scheduled job (cron or a queue worker). If this job stops running, your storage fills up and expired pastes remain visible.
- In Vigilmon, click Add Monitor → Cron Heartbeat.
- Set the expected ping interval to match your cleanup job schedule (e.g.
60minutes for an hourly cron). - Copy the heartbeat URL:
https://vigilmon.online/heartbeat/YOUR_TOKEN. - Append a curl call to your cleanup script:
#!/bin/bash
# /opt/snappaste/bin/cleanup.sh
php artisan pastes:cleanup
curl -s https://vigilmon.online/heartbeat/YOUR_TOKEN
Or in a Laravel-style cron entry (/etc/cron.d/snappaste):
0 * * * * www-data php /var/www/snappaste/artisan pastes:cleanup && curl -s https://vigilmon.online/heartbeat/YOUR_TOKEN
If the job fails mid-run or the host's cron daemon stops, the heartbeat goes silent and Vigilmon alerts you.
Step 6: SSL/TLS Certificate Expiry
Paste services are often accessed from browsers and CI pipelines that enforce HTTPS. A lapsed certificate breaks curl | bash workflows silently.
- Open the HTTP monitor you created in Step 1.
- Enable Monitor SSL certificate.
- Set Alert when certificate expires in less than
21 days. - Click Save.
Twenty-one days gives you enough runway to investigate renewal failures (failed ACME challenge, expired DNS token) and renew manually before any outage.
Step 7: Configure Alert Channels
- Go to Alert Channels in Vigilmon and add Slack, email, or a webhook.
- Set Consecutive failures before alert to
2on the web interface monitor — a single slow check is noise; two consecutive failures are signal. - Route database and cleanup heartbeat alerts to a higher-urgency channel (e.g. PagerDuty webhook) since these failures are not self-healing.
Summary
| Monitor | Target | What It Catches |
|---|---|---|
| HTTP — web interface | https://paste.yourdomain.com | Web server / PHP-FPM crash |
| HTTP — paste creation | POST / | Write path regression, DB pool exhaustion |
| HTTP — paste retrieval | /abc123 (canary paste) | Read path failure, syntax highlighter crash |
| TCP — database | :3306 or :5432 | Database process down |
| HTTP — DB health probe | /health.php | Database query failure |
| Cron heartbeat | cleanup script | Expired-paste cleanup job failure |
| SSL certificate | paste domain | TLS renewal failure |
Self-hosting Snappaste means owning every layer from the web process to the cleanup cron. With Vigilmon watching each one, you catch database exhaustion before pastes fail to save, storage bloat before disk fills up, and certificate expiry before browsers start blocking your team's paste links.