tutorial

Monitoring Microbin with Vigilmon

Microbin is a self-hosted paste and URL shortener written in Rust — but when it goes down, every shortened URL breaks and every shared paste 404s. Here's how to monitor Microbin's uptime, paste API, URL redirect service, and storage health with Vigilmon.

Microbin is a lightweight self-hosted paste service and URL shortener written in Rust, running on port 8080. It stores pastes on disk with configurable expiration, provides syntax highlighting for code pastes, and serves instant redirects for shortened URLs. Because it's intentionally minimal — no external database, no cloud dependency — it's also resilient to the kinds of failures that plague complex stacks. But "resilient" isn't "invincible": a full disk, a process crash, or a storage permission issue can silently break every shortened URL you've ever shared. Vigilmon watches Microbin continuously so you catch those failures before your links go dead.

What You'll Set Up

  • Web server uptime monitor (port 8080)
  • Paste creation API health check
  • URL shortener redirect service probe
  • Paste expiration cleanup job heartbeat
  • Syntax highlighting service verification
  • Storage backend availability check

Prerequisites

  • Microbin running and accessible on port 8080
  • A free Vigilmon account

Step 1: Monitor Microbin Web Server Uptime

The root endpoint confirms the Rust web server (Actix-web) is running and serving the Microbin UI:

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Microbin URL: http://YOUR_SERVER_IP:8080.
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Click Save.

If Microbin is behind a reverse proxy, monitor the proxied domain. Enable Monitor SSL certificate with a 21 day expiry alert if you're serving HTTPS — a Microbin instance with an expired cert silently breaks all HTTPS links shared from it.

Microbin starts in under a second thanks to Rust's compiled binary with no JVM or interpreter warmup. If this monitor reports down, the process has crashed or the host system is having issues — there's no "still starting" grace period to account for.


Step 2: Monitor the Paste Creation API

Paste creation is Microbin's core function. A healthy POST to the paste endpoint confirms the web server is processing requests and writing to the storage backend:

  1. Click Add MonitorHTTP / HTTPS.
  2. Set Method to POST.
  3. Enter: http://YOUR_SERVER_IP:8080/api/save.
  4. Set Content-Type header to application/x-www-form-urlencoded.
  5. Set Request body to content=vigilmon-health-check&expiration=never&privacy=public.
  6. Set Expected HTTP status to 200 or 302 (Microbin redirects to the created paste after successful creation).
  7. Set Check interval to 5 minutes.
  8. Click Save.

Note: This will create a real paste in your Microbin instance each time it runs. Set the expiration to a short value (e.g., 1hour) to avoid accumulating test pastes. Alternatively, use the response body check to confirm you receive the paste view page markup.

A failure here with the root URL still returning 200 indicates a storage write failure — check disk space and permissions on the Microbin data directory:

# Check available disk space
df -h /path/to/microbin/data

# Check directory permissions
ls -la /path/to/microbin/data

Step 3: Monitor the URL Shortener Redirect Service

Every shortened URL Microbin serves is a redirect from a short code to the destination. If Microbin goes down, every one of those links breaks immediately — and there's no CDN or cached redirect layer to absorb the failure.

Create a permanent test redirect in your Microbin instance (set expiration to never), then monitor it:

  1. Create a test URL shortener entry in Microbin pointing to https://vigilmon.online.
  2. Note the short code from the resulting URL (e.g., http://YOUR_SERVER_IP:8080/SHORTCODE).
  3. Click Add MonitorHTTP / HTTPS.
  4. Enter: http://YOUR_SERVER_IP:8080/SHORTCODE.
  5. Set Expected HTTP status to 301 or 302.
  6. Under Follow redirects, leave disabled — you want to confirm Microbin is serving the redirect, not that the destination is up.
  7. Set Check interval to 2 minutes.
  8. Click Save.

This probe verifies that the paste storage is readable (Microbin looks up the redirect target from disk on every request) and the HTTP server is correctly handling the redirect response. A 404 means the short code is missing from storage; a 500 means a read error on the storage backend.


Step 4: Monitor Syntax Highlighting Service

When users view code pastes, Microbin applies syntax highlighting using its built-in highlighting engine. A paste with a known code type can verify this rendering path is working:

  1. Create a test code paste in Microbin with a specific language (e.g., rust) and set expiration to never. Note the paste URL.
  2. Click Add MonitorHTTP / HTTPS.
  3. Enter the paste view URL: http://YOUR_SERVER_IP:8080/YOUR_PASTE_ID.
  4. Set Expected HTTP status to 200.
  5. Under Response body contains, enter highlight or language- to confirm syntax highlighting markup is present in the rendered output.
  6. Set Check interval to 10 minutes.
  7. Click Save.

Step 5: Heartbeat for Paste Expiration Cleanup

Microbin removes expired pastes on a background schedule. If the cleanup job stalls, your storage fills up with expired content until disk pressure causes the service to fail. Monitor cleanup job health with a Vigilmon heartbeat:

Add a cron job on your host that checks for the expiration cleanup signal and pings Vigilmon:

#!/bin/bash
# Check that Microbin's data directory hasn't grown unexpectedly large
DATA_DIR="/path/to/microbin/data"
PASTE_COUNT=$(find "$DATA_DIR" -name "*.json" | wc -l)

# Alert if paste count exceeds expected maximum (adjust threshold for your usage)
if [ "$PASTE_COUNT" -lt 10000 ]; then
  curl -s https://vigilmon.online/heartbeat/YOUR_HEARTBEAT_ID
fi

Set up the heartbeat in Vigilmon:

  1. Click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to 1440 minutes (24 hours) to match a daily cleanup check.
  3. Copy the heartbeat URL and paste it into your script.
  4. Add the script to cron: 0 3 * * * /usr/local/bin/check-microbin-cleanup.sh.
  5. Click Save.

Alternatively, if you run Microbin in Docker, monitor the container restart count as a proxy for crash-loop failures:

# Add to cron — alert if Microbin has restarted more than 3 times today
RESTART_COUNT=$(docker inspect microbin --format '{{.RestartCount}}')
if [ "$RESTART_COUNT" -lt 3 ]; then
  curl -s https://vigilmon.online/heartbeat/YOUR_HEARTBEAT_ID
fi

Step 6: Monitor Storage Backend Availability

Microbin stores all pastes as files in a data directory. A simple TCP check on the host confirms the server is reachable at the network level, giving you a second-opinion monitor independent of the application:

  1. Click Add MonitorTCP Port.
  2. Enter your server's hostname or IP.
  3. Set Port to 8080.
  4. Set Check interval to 1 minute.
  5. Click Save.

For a disk-level storage check, add a script that writes and reads a test file, pinging Vigilmon only when both succeed:

#!/bin/bash
TEST_FILE="/path/to/microbin/data/.vigilmon-health"

# Verify write and read on the data directory
echo "ok" > "$TEST_FILE" && cat "$TEST_FILE" > /dev/null

if [ $? -eq 0 ]; then
  rm -f "$TEST_FILE"
  curl -s https://vigilmon.online/heartbeat/YOUR_STORAGE_HEARTBEAT_ID
fi

Run this script every 15 minutes via cron. A storage heartbeat failure before the web server monitor fires gives you an early warning that disk issues are developing.


Step 7: Configure Alerts

Microbin is often used to share links publicly — a down instance means immediate broken links for anyone who clicks them:

  1. Go to Alert Channels in Vigilmon and add email and Slack (or a webhook to your preferred notification tool).
  2. Set Consecutive failures before alert to 1 for the web server and redirect monitors — Microbin restarts instantly; two consecutive failures in two minutes means something is genuinely wrong.
  3. For the paste creation API monitor, set to 2 to tolerate a momentary storage hiccup.
  4. Use Maintenance windows during updates:
# Open a maintenance window before updating the Microbin binary
curl -X POST https://vigilmon.online/api/maintenance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"monitor_id": "YOUR_MONITOR_ID", "duration_minutes": 5}'

# Stop, update, and restart
docker compose pull microbin && docker compose up -d microbin

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web server | http://HOST:8080 | Rust process crash, port unavailable | | Paste API | POST /api/save | Storage write failure, disk full | | URL redirect | GET /SHORTCODE | Storage read failure, missing paste | | Syntax highlight | Paste view page | Rendering engine failure | | Cleanup heartbeat | Heartbeat URL | Expiration cleanup job stalled | | TCP port | :8080 | Host network / firewall issue | | Storage heartbeat | Heartbeat URL | Disk I/O or permission issue |

Microbin's Rust foundation makes it one of the most stable self-hosted services you can run — a single binary with no runtime dependencies and no database to manage. But every link you share from it is only as reliable as your server. With Vigilmon watching the web server, redirect service, and storage backend, you'll know within a minute when your paste service needs attention, not after someone reports a broken link.

Monitor your app with Vigilmon

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

Start free →