tutorial

Monitoring Dufs with Vigilmon

Dufs is your self-hosted file server with WebDAV and HTTP upload support — but it has no built-in uptime dashboard. Here's how to monitor HTTP availability, TLS certificates, WebDAV endpoints, and disk space with Vigilmon.

Dufs is a simple, fast, and powerful self-hosted file server written in Rust. It supports WebDAV, HTTP upload and download, directory browsing, and optional authentication — all from a single binary on port 5000. Whether you're using it as a personal cloud drive replacement, a CI artifact store, or a team file share, Dufs sits in the critical path of your file workflows. When Dufs goes down, uploads fail, WebDAV clients disconnect, and automations that depend on file access break silently. Vigilmon keeps Dufs under continuous observation so file access stays reliable.

What You'll Set Up

  • HTTP server availability monitor
  • TLS/HTTPS certificate expiry alert
  • WebDAV endpoint response time monitor
  • File upload and download endpoint health checks
  • Directory listing service monitor
  • Authentication health check (if configured)
  • Disk space threshold monitor
  • Large file chunked upload service monitor
  • Rate limiting middleware monitor

Prerequisites

  • Dufs running on port 5000 (or custom port), accessible over HTTP or HTTPS
  • A free Vigilmon account

Step 1: Monitor HTTP Server Availability

Dufs serves all requests from a single HTTP listener. Start with a basic availability check on the root path:

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Dufs URL: https://files.yourdomain.com/ (or http://your-server-ip:5000/).
  4. Set Check interval to 1 minute.
  5. Set Expected HTTP status to 200.
  6. Click Save.

Dufs returns a 200 with the directory listing HTML for the root path. If you have authentication enabled, it will return 401 — adjust the expected status or add credentials (see Step 6).


Step 2: Monitor TLS Certificate Expiry

If Dufs is served over HTTPS (either directly with its built-in TLS support or via a reverse proxy), set up certificate expiry monitoring:

  1. Open the HTTP monitor created in Step 1.
  2. Enable Monitor SSL certificate under the SSL section.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

Dufs supports built-in TLS with --tls-cert and --tls-key flags. Certificates issued by Let's Encrypt auto-renew, but the renewal can fail silently — a 21-day window gives you time to investigate and reissue manually:

# Renew certificate manually (certbot example)
certbot renew --cert-name files.yourdomain.com
# Then restart Dufs to pick up the new certificate
systemctl restart dufs

Step 3: Monitor WebDAV Endpoint Response Times

Dufs fully implements the WebDAV protocol, making it compatible with macOS Finder, Windows network drives, and tools like Cyberduck. The WebDAV PROPFIND method is the standard health probe:

curl -X PROPFIND https://files.yourdomain.com/ \
  -H "Depth: 0" \
  -H "Content-Type: application/xml" \
  -o /dev/null -w "%{http_code} %{time_total}s"
# 207 0.045s

A 207 Multi-Status response is the expected WebDAV success code. Monitor this with a cron heartbeat script:

#!/bin/bash
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
  -X PROPFIND "https://files.yourdomain.com/" \
  -H "Depth: 0")

if [ "$STATUS" = "207" ]; then
  curl -s "https://vigilmon.online/heartbeat/WEBDAV_HEARTBEAT_ID"
fi
  1. In Vigilmon, add a Cron Heartbeat monitor with a 5 minute interval.
  2. Schedule the script with cron or systemd timer.

Step 4: Monitor File Upload Health

File upload is Dufs's core function. Verify uploads are working end-to-end with a probe script:

#!/bin/bash
# Create a small test file
echo "vigilmon-probe-$(date +%s)" > /tmp/probe.txt

# Upload to Dufs
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
  -X PUT "https://files.yourdomain.com/probe.txt" \
  -T /tmp/probe.txt)

if [ "$STATUS" = "201" ] || [ "$STATUS" = "204" ]; then
  # Clean up
  curl -s -X DELETE "https://files.yourdomain.com/probe.txt"
  curl -s "https://vigilmon.online/heartbeat/UPLOAD_HEARTBEAT_ID"
fi

rm /tmp/probe.txt
  1. Add a Cron Heartbeat monitor with a 5 minute interval.
  2. Run the script from a cron job every 5 minutes.

A 201 Created or 204 No Content response confirms the upload path (including the underlying filesystem write) is working correctly.


Step 5: Monitor File Download Health

Verify the download path by fetching a known file that you keep permanently in Dufs:

#!/bin/bash
# Download a small probe file that is always present
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
  "https://files.yourdomain.com/.probe/ping.txt")

if [ "$STATUS" = "200" ]; then
  curl -s "https://vigilmon.online/heartbeat/DOWNLOAD_HEARTBEAT_ID"
fi

Place a small static file at /.probe/ping.txt in your Dufs data directory and keep it permanently. This gives you a stable download target that never changes.


Step 6: Monitor Directory Listing Service

Dufs's directory listing is the primary UI for browser-based file access. Monitor it with a keyword check:

  1. Add an HTTP / HTTPS monitor.
  2. URL: https://files.yourdomain.com/.
  3. Expected status: 200.
  4. Add a Keyword check: Index of or any known subdirectory name you expect to appear in the listing.
  5. Interval: 5 minutes.

The keyword check catches cases where Dufs returns a 200 but serves an error page or partial response.


Step 7: Monitor Authentication Health (If Configured)

If you run Dufs with --auth or --allow-all/--allow-upload restrictions, verify that authentication is working correctly:

#!/bin/bash
# Attempt access with valid credentials
VALID_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
  -u "username:password" \
  "https://files.yourdomain.com/")

# Attempt access without credentials (should be denied)
INVALID_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
  "https://files.yourdomain.com/")

if [ "$VALID_STATUS" = "200" ] && [ "$INVALID_STATUS" = "401" ]; then
  curl -s "https://vigilmon.online/heartbeat/AUTH_HEARTBEAT_ID"
fi

This verifies both that authenticated access works and that unauthenticated access is correctly denied. A misconfiguration that allows unauthenticated access is just as serious as one that blocks all access.


Step 8: Monitor Disk Space

Dufs writes directly to the filesystem. When the disk fills up, uploads fail with HTTP 500 or write errors. Set up a disk space monitor:

#!/bin/bash
# Check disk usage percentage for the Dufs data directory
USAGE=$(df /path/to/dufs/data | awk 'NR==2{print $5}' | tr -d '%')

if [ "$USAGE" -lt 85 ]; then
  curl -s "https://vigilmon.online/heartbeat/DISK_HEARTBEAT_ID"
fi
  1. Add a Cron Heartbeat monitor in Vigilmon with a 10 minute interval.
  2. Run the script from cron every 10 minutes.

Set the threshold at 85% to give yourself time to clean up or expand storage before the disk fills completely. At 100% disk usage, new uploads start failing immediately.


Step 9: Monitor Large File Chunked Upload Support

For large files, clients may use chunked transfer encoding. Verify that the Dufs process and the upstream reverse proxy (nginx, Caddy) are not truncating large uploads:

#!/bin/bash
# Generate a 10 MB probe file
dd if=/dev/urandom of=/tmp/probe_large.bin bs=1M count=10 2>/dev/null

# Upload with chunked transfer
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
  -X PUT "https://files.yourdomain.com/probe_large.bin" \
  -T /tmp/probe_large.bin \
  -H "Transfer-Encoding: chunked")

if [ "$STATUS" = "201" ] || [ "$STATUS" = "204" ]; then
  curl -s -X DELETE "https://files.yourdomain.com/probe_large.bin"
  curl -s "https://vigilmon.online/heartbeat/LARGE_UPLOAD_HEARTBEAT_ID"
fi

rm /tmp/probe_large.bin

Run this check hourly. If your reverse proxy has a client_max_body_size limit that is too low, large uploads will fail with 413 Request Entity Too Large — this check catches that misconfiguration.


Step 10: Configure Alerts and Summary

In Vigilmon, go to Alert Channels and add Slack or email notifications. Recommended thresholds:

  • Consecutive failures before alert: 2 for the HTTP availability monitor.
  • Consecutive failures before alert: 1 for the upload heartbeat — any upload failure is a critical event.
  • SSL alert: 21 days before certificate expiry.

| Monitor | Target | What It Catches | |---|---|---| | HTTP availability | Root URL | Dufs process down | | TLS certificate | Root domain | Certificate expiry, HTTPS broken | | WebDAV PROPFIND | / heartbeat | WebDAV protocol failure | | File upload | PUT heartbeat | Upload path broken, disk full | | File download | GET heartbeat | Download path broken | | Directory listing | Root URL keyword | Partial response, index broken | | Authentication | Auth heartbeat | Auth bypass or lockout | | Disk space | df heartbeat | Disk filling, pre-failure warning | | Chunked upload | Large PUT heartbeat | Proxy body size limit hit |

Dufs is a Rust binary with no external runtime dependencies — it rarely crashes. But the infrastructure around it (disk space, TLS certificates, reverse proxy config, network routing) fails regularly. With Vigilmon checking every layer from TLS to disk usage, you'll catch the surrounding failures before they affect your file workflows.

Monitor your app with Vigilmon

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

Start free →