luisdralves 8bd674fda0
All checks were successful
Build and Deploy / build-deploy (push) Successful in 52s
Add readme
2026-03-31 22:51:46 +01:00
2026-03-31 21:47:06 +01:00
2026-03-31 21:47:17 +01:00
2026-03-31 21:47:06 +01:00
2026-03-31 21:47:17 +01:00
2026-03-31 21:47:17 +01:00
2026-03-31 22:51:46 +01:00

srvmon

Real-time monitor for Caddy access logs. Displays two columns:

  • Latest: recent activity, grouped into consecutive runs by service
  • Top: all-time request counts per service, sorted descending

Watches the log directory with inotify so updates appear instantly. Handles both plain .access.log files and rotated .access.log.gz archives. Persists state to .srvmon.state.json in the log directory to avoid re-counting on restart.

Requirements

  • Linux (uses inotify)
  • Caddy access logs in JSON format (<service>.access.log)

Building

cargo build --release

Usage

srvmon [OPTIONS]
Option Default Description
-d, --dir <DIR> /var/log/caddy Log directory path
-l, --lines <N> 8 Number of lines per column
-b, --bind <ADDR> 127.0.0.1 HTTP server bind address
-p, --port <PORT> 8080 HTTP server port
--no-tui Disable terminal display
--no-http Disable HTTP server

HTTP interface

By default, srvmon serves a web UI on http://127.0.0.1:8080 that mirrors the terminal display via Server-Sent Events. The SSE endpoint is available at /events.

Description
Service monitor
Readme 48 KiB
Languages
Rust 100%