tutorial

Monitoring Rustypaste with Vigilmon

Rustypaste is your self-hosted minimal paste service written in Rust — but silent upload failures and paste expiration issues are hard to catch without external monitoring. Here's how to monitor your Rustypaste endpoints, storage backend, and cleanup jobs with Vigilmon.

Rustypaste is a no-frills, self-hosted paste service written in Rust — fast, lightweight, and designed to run as a single binary with file-based storage. It handles text pastes, file uploads, burn-after-reading links, and paste expiration, all on port 8000 by default. When the upload endpoint silently returns errors, storage fills up, or expired-paste cleanup stops running, your users get broken links with no built-in alert. Vigilmon provides the uptime monitoring layer Rustypaste doesn't ship with, so you know the moment your paste service needs attention.

What You'll Set Up

  • Web service availability monitor (port 8000)
  • Paste creation API health check
  • File upload endpoint availability probe
  • Burn-after-reading (one-shot) service health check
  • Paste expiration cleanup job heartbeat
  • Storage backend (local/S3) connectivity probe

Prerequisites

  • Rustypaste running and accessible on port 8000
  • A free Vigilmon account

Step 1: Monitor the Rustypaste Web Service

The root endpoint confirms the Rust binary is alive and accepting connections:

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

If Rustypaste is behind a reverse proxy (nginx, Caddy, Traefik), monitor the proxied URL. The root path returns a minimal HTML or redirect response — a 200 here confirms the binary is running and the TCP listener is up.


Step 2: Monitor the Paste Creation API

The primary function of Rustypaste is accepting content submissions. Test the paste endpoint directly to confirm uploads are being processed:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter the health-check URL: http://YOUR_SERVER_IP:8000/health (or your configured health path).
  3. Set Expected HTTP status to 200.
  4. Set Check interval to 2 minutes.
  5. Click Save.

If Rustypaste does not expose a dedicated /health endpoint in your version, probe the version endpoint instead:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter: http://YOUR_SERVER_IP:8000/version.
  3. Set Expected HTTP status to 200.
  4. Under Response body contains, enter rustypaste to confirm a valid version string is returned.
  5. Set Check interval to 2 minutes.
  6. Click Save.

A failure here means the paste API is unreachable even though the port may still accept TCP connections.


Step 3: Monitor the File Upload Endpoint

Rustypaste handles file uploads via a multipart/form-data POST to the root path. Validate this pathway is reachable with a lightweight probe:

  1. Click Add MonitorHTTP / HTTPS.
  2. Enter: http://YOUR_SERVER_IP:8000.
  3. Set Method to POST.
  4. Set Expected HTTP status to 200 or 400 — a 400 from a malformed empty POST confirms the upload handler is active and parsing requests; a 405 would indicate the route is misconfigured.
  5. Set Check interval to 5 minutes.
  6. Click Save.

Tip: If your Rustypaste instance requires an authentication token, add the Authorization: Bearer YOUR_AUTH_TOKEN header under Custom Headers so the probe is not rejected by auth middleware before reaching the upload handler.


Step 4: Monitor One-Shot (Burn After Reading) Service Health

Rustypaste supports one-shot pastes that delete themselves after the first view. These rely on filesystem operations completing atomically. Probe the one-shot upload path to confirm this feature is operational:

  1. Use a cron heartbeat to periodically create a test one-shot paste and verify it returns a valid URL:
#!/bin/bash
# Create a test one-shot paste
RESPONSE=$(curl -s -X POST http://YOUR_SERVER_IP:8000 \
  -F "oneshot=test-oneshot-probe" \
  -H "Authorization: Bearer YOUR_AUTH_TOKEN")

# A valid response contains a URL pointing to the stored paste
if echo "$RESPONSE" | grep -q "http"; then
  curl -s https://vigilmon.online/heartbeat/YOUR_ONESHOT_HEARTBEAT_ID
fi
  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set expected ping interval to 30 minutes.
  3. Copy the heartbeat URL into the script above.
  4. Click Save.

If one-shot paste creation fails (storage full, permissions error, filesystem corruption), Vigilmon alerts after the expected interval without a ping.


Step 5: Heartbeat for Paste Expiration Cleanup

Rustypaste runs a background job that deletes expired pastes based on the expire_files setting in your config. This job produces no HTTP output when it runs. Use a Vigilmon cron heartbeat to detect when cleanup stops:

Add a systemd timer or cron job that checks for Rustypaste's cleanup activity and pings Vigilmon on success:

#!/bin/bash
# Verify Rustypaste process is alive and responsive
HEALTH=$(curl -s -o /dev/null -w "%{http_code}" \
  --max-time 5 http://YOUR_SERVER_IP:8000/version)

if [ "$HEALTH" -eq 200 ]; then
  # Service is up; treat as cleanup job still running
  curl -s https://vigilmon.online/heartbeat/YOUR_CLEANUP_HEARTBEAT_ID
fi

Set up in Vigilmon:

  1. Click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to match your cleanup schedule (e.g., 60 minutes).
  3. Copy the heartbeat URL and paste it into the script.
  4. Add the script to crontab: 0 * * * * /usr/local/bin/check-rustypaste.sh
  5. Click Save.

Step 6: Monitor Storage Backend Connectivity

Rustypaste stores pastes on the local filesystem or in an S3-compatible bucket. A full disk or lost S3 credentials cause upload failures without crashing the service. Detect storage problems early:

For local filesystem storage, monitor disk usage:

#!/bin/bash
# Check paste storage directory is writable and not critically full
USAGE=$(df /path/to/rustypaste/upload | awk 'NR==2 {print $5}' | tr -d '%')

if [ "$USAGE" -lt 90 ]; then
  curl -s https://vigilmon.online/heartbeat/YOUR_STORAGE_HEARTBEAT_ID
fi

For S3-compatible storage, create a test object periodically:

#!/bin/bash
# Test S3 write access
aws s3 cp /dev/stdin s3://YOUR_BUCKET/probe-$(date +%s).txt \
  --content-type text/plain <<< "vigilmon-probe" \
  --quiet 2>/dev/null

if [ $? -eq 0 ]; then
  curl -s https://vigilmon.online/heartbeat/YOUR_S3_HEARTBEAT_ID
fi

Add a Cron Heartbeat monitor in Vigilmon with a 15-minute interval for each storage probe.


Step 7: Configure Alerts and Maintenance Windows

  1. Go to Alert Channels in Vigilmon and add email, Slack, or a webhook endpoint.
  2. For the main service and upload API monitors, set Consecutive failures before alert to 2 to avoid false alerts from brief Rust GC pauses.
  3. For storage monitors, set to 1 for immediate notification — a full disk causes immediate upload failures.
  4. Use Maintenance windows when updating Rustypaste to suppress alerts during the restart:
# Open a 5-minute maintenance window before updating
curl -X POST https://vigilmon.online/api/maintenance \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"monitor_id": "YOUR_MONITOR_ID", "duration_minutes": 5}'

# Pull the latest Rustypaste binary and restart
systemctl restart rustypaste

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web service | http://HOST:8000 | Binary crash, TCP listener down | | Version/health API | /version or /health | Paste API unreachable | | Upload endpoint | POST / | Upload handler misconfigured or failing | | One-shot heartbeat | Heartbeat URL | Burn-after-reading writes failing | | Cleanup heartbeat | Heartbeat URL | Expiration job not running | | Storage probe | Filesystem / S3 | Disk full or S3 credentials lost |

Rustypaste's simplicity is its strength — but that same minimalism means no built-in health dashboard, no alert system, and no visibility into storage problems until users start reporting broken paste links. With Vigilmon watching every critical path from upload acceptance to storage health, you catch failures before they reach your users.

Monitor your app with Vigilmon

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

Start free →