Hastebin is an open source code and text paste server inspired by Pastebin, designed for quickly sharing code snippets with syntax highlighting. It runs as a Node.js application on port 7777 and supports multiple storage backends — Redis, Memcached, file-based, or S3 — giving you flexibility but also multiple failure points. When Hastebin goes down, developers lose access to shared snippets mid-workflow and paste links in chat history lead nowhere. Vigilmon keeps Hastebin reliably available by monitoring every critical layer, from paste creation to TLS certificate expiry.
What You'll Set Up
- Web server availability monitor on port 7777
- Paste creation endpoint response times (
/documentsPOST) - Paste retrieval health (
/raw/:keyand/documents/:key) - Storage backend connectivity (Redis, Memcached, or file-based)
- HTTPS/TLS certificate expiry alerts
- Document expiry and cleanup job heartbeat
- Disk space threshold monitoring for file-based storage
Prerequisites
- Hastebin running at
http://your-server:7777(or behind a reverse proxy on port 80/443) - One of: Redis, Memcached, file, or S3 configured as the storage backend
- A free Vigilmon account
Step 1: Monitor Web Server Availability
The first and most fundamental check is whether Hastebin's Node.js server is responding at all.
- Log in to vigilmon.online and click Add Monitor.
- Set Type to
HTTP / HTTPS. - Enter your Hastebin URL:
http://your-server:7777(orhttps://paste.yourdomain.comif behind a proxy). - Set Check interval to
1 minute. - Set Expected HTTP status to
200. - Under Content verification, enter
hasteoraboutas a keyword to confirm the UI rendered. - Click Save.
This catches Node.js crashes, port binding failures, and reverse proxy misconfigurations in one monitor.
Step 2: Monitor Paste Creation Endpoint
The /documents POST endpoint is the core write operation of Hastebin. A slow or broken paste creation endpoint means users can't save any new snippets.
- Click Add Monitor →
HTTP / HTTPS. - URL:
http://your-server:7777/documents. - Set Method to
POST. - Add header
Content-Type: text/plain. - Set Request body to
vigilmon-health-check(a harmless test document). - Set Expected HTTP status to
200. - Set Response time threshold to
2000ms— paste creation should be near-instant. - Click Save.
A successful response from /documents returns a JSON body like {"key":"abc123"}. If your Vigilmon plan supports body assertions, verify the response contains "key" to confirm the write completed successfully rather than returning an error JSON.
Note: This monitor will create a real document in your Hastebin storage on every check. Most storage backends handle this gracefully, but if you want to avoid accumulating test documents, use a separate cleanup rule or monitor only with GET checks as described in the next step.
Step 3: Monitor Paste Retrieval Endpoints
Reads are the most frequent operation — every time someone opens a shared link, Hastebin fetches from storage. Monitor both retrieval paths:
Raw content endpoint. First, create a permanent test document manually in Hastebin and note its key (e.g. test1234).
- Click Add Monitor →
HTTP / HTTPS. - URL:
http://your-server:7777/raw/test1234. - Expected status:
200. - Content verification: enter the first few words of your test document.
- Set Check interval to
2 minutes.
JSON documents endpoint.
- Click Add Monitor →
HTTP / HTTPS. - URL:
http://your-server:7777/documents/test1234. - Expected status:
200. - Content verification:
"data"(confirms the JSON payload structure is intact).
If either retrieval monitor fails while the web server monitor passes, the storage backend has a read-path failure — a more specific and actionable alert.
Step 4: Monitor the Storage Backend
The storage backend is the most common cause of Hastebin outages. Choose the monitor type that matches your configuration.
Redis backend:
- Click Add Monitor → TCP Port.
- Host:
localhost(or your Redis host), Port:6379. - Set Check interval to
1 minute.
For a more complete Redis health check, add a script probe:
#!/bin/bash
redis-cli -h localhost PING | grep -q PONG && echo "ok" || echo "error"
Wrap this in an HTTP endpoint and monitor it expecting ok.
Memcached backend:
- Click Add Monitor → TCP Port.
- Host:
localhost, Port:11211. - Set Check interval to
1 minute.
File-based backend. There's no port to probe for file storage — monitor disk space instead:
#!/bin/bash
# /opt/hastebin/scripts/disk-health.sh
STORE_DIR="/opt/hastebin/data"
USAGE=$(df -P "$STORE_DIR" | awk 'NR==2 {print $5}' | tr -d '%')
if [ "$USAGE" -gt 85 ]; then
echo "error: disk ${USAGE}% full"
exit 1
fi
echo "ok: disk ${USAGE}% used"
Expose this via a local HTTP server and add a Vigilmon HTTP monitor expecting ok in the response body. Alert when disk usage exceeds 85% — at 95% Hastebin will start failing writes with no visible warning to users.
S3 backend. Monitor S3 connectivity:
- Click Add Monitor →
HTTP / HTTPS. - URL:
https://s3.amazonaws.com(or your S3-compatible endpoint). - Expected status:
200or403— both confirm S3 is reachable.
Step 5: Monitor TLS Certificate Expiry
If Hastebin is exposed over HTTPS (via nginx or Caddy as a reverse proxy), a lapsed TLS certificate will immediately break all paste links for every user.
- Open the HTTP monitor for your Hastebin URL (from Step 1).
- Enable Monitor SSL certificate.
- Set Alert when certificate expires in less than
21 days. - Save.
A 21-day window gives you enough time to investigate and renew without a service interruption. If you use Let's Encrypt, verify auto-renewal is working by checking the renewal log:
# Confirm certbot renewed recently
grep "renewal" /var/log/letsencrypt/letsencrypt.log | tail -5
Vigilmon's SSL alert is an independent safety net for when auto-renewal silently fails.
Step 6: Heartbeat for Document Expiry and Cleanup Jobs
Hastebin supports document expiry — old pastes are removed after a configurable period. If the cleanup job fails, storage fills up over time and write operations eventually fail.
- In Vigilmon, click Add Monitor → Cron Heartbeat.
- Set the expected interval to match your cleanup schedule (e.g.
60minutes for hourly cleanup). - Copy the heartbeat URL:
https://vigilmon.online/heartbeat/abc123.
Add the ping to your cleanup script or cron job:
#!/bin/bash
# /opt/hastebin/scripts/cleanup.sh
node /opt/hastebin/server.js --cleanup 2>&1 | logger -t hastebin-cleanup
if [ $? -eq 0 ]; then
curl -s https://vigilmon.online/heartbeat/abc123
fi
Or if using a built-in expiry mechanism in Hastebin's config, wrap the Node.js process startup in a systemd service with a ExecStartPost hook that pings Vigilmon on successful startup.
Step 7: Configure Alert Channels
- Go to Alert Channels in Vigilmon and connect Slack, email, or a webhook.
- For the paste creation monitor, set Consecutive failures before alert to
2— transient POST failures are more common than persistent ones. - For web server availability, set it to
2— a brief Node.js restart shouldn't wake anyone. - For the storage backend TCP monitors, set to
1— a storage outage is immediately critical and should alert right away. - For the SSL certificate monitor, use Email for advance warning — no need for an on-call wake.
Summary
| Monitor | Target | What It Catches |
|---|---|---|
| Web server | http://your-server:7777 | Node.js crash, port failure |
| Paste creation | POST /documents | Write path broken, storage rejecting writes |
| Raw retrieval | GET /raw/:key | Read path failure |
| JSON retrieval | GET /documents/:key | API deserialization broken |
| Redis/Memcached (TCP) | localhost:6379 or 11211 | Backend connectivity |
| Disk space (file) | Script probe | Storage nearly full |
| S3 connectivity | S3 endpoint HTTP | Object storage unreachable |
| TLS certificate | HTTPS monitor | Certificate expired or expiring |
| Cleanup heartbeat | Heartbeat URL | Expiry job crashed, storage growing |
Hastebin's simplicity is its strength, but that simplicity can also make failures invisible — there are no admin dashboards or built-in health endpoints to check. With Vigilmon probing every write path, read path, and storage backend on a schedule, you get immediate visibility into Hastebin availability without any changes to Hastebin's source code.