Lightweight HTTP monitoring server implemented in Zig, single-threaded event loop using epoll.
Version: 0.0.1
Requires Zig 0.13.0+.
zig build-exe moni.zig -O ReleaseSafe -target native-linux-gnu
./moni # Start on port 8080
./moni -p 9090 # Custom port
./moni -f /tmp/flag # Set file path via CLI
MONI_PATH=/tmp/flag ./moni # Set file path via env
./moni -v # Enable verbose logging
./moni -h # Show help
| Path | Description | Response |
|---|---|---|
/version | Server version | 0.0.1 |
/hostname | Machine hostname | e.g. myserver |
| Any other | File existence check | 1 (exists) / 0 (not exists) / 500 (not configured) |
| Flag | Description | Default |
|---|---|---|
-p PORT | Listen port | 8080 |
-f PATH | File path to check | — |
-v | Verbose request/response logging | off |
-h | Show help | — |
File path can also be set via MONI_PATH environment variable. CLI -f takes priority.
# Terminal 1
MONI_PATH=/tmp/flag ./moni -v
# Terminal 2
curl http://localhost:8080/version # 0.0.1
curl http://localhost:8080/hostname # myserver
touch /tmp/flag
curl http://localhost:8080/check # 1
rm /tmp/flag
curl http://localhost:8080/check # 0