From fdfea400269938e86a4e234014626fe75020152a Mon Sep 17 00:00:00 2001 From: hartsock Date: Sun, 6 Sep 2026 18:26:00 -0400 Subject: [PATCH] docs: trim README rot, move full config example to docs/ Two spots in the README would go stale in place: the Roadmap section restated the current phase (already tracked in docs/ROADMAP.md, so it would drift the moment that changes), and the "Full config example" was a straight duplicate of the targets/rules/notify snippets already shown individually above it. Moved the combined example to docs/CONFIGURATION.md and pointed to it instead of inlining it twice. Co-Authored-By: Claude Sonnet 5 --- README.md | 54 +++---------------------------------------- docs/CONFIGURATION.md | 54 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 51 deletions(-) create mode 100644 docs/CONFIGURATION.md diff --git a/README.md b/README.md index 290ebda..01fa7ab 100644 --- a/README.md +++ b/README.md @@ -174,55 +174,8 @@ webhook = "" # set to a URL to enable ## Full config example -```toml -[daemon] -socket = "" # default: $XDG_RUNTIME_DIR/monitor-agent.sock - -[[targets]] -name = "local" -kind = "local" - -[[targets]] -name = "gnuc" -kind = "prometheus" -endpoint = "http://192.168.0.104:9090" - -[[targets]] -name = "nuc" -kind = "ssh" -host = "192.168.0.104" -user = "hartsock" -key = "~/.ssh/id_ed25519" - -[nats] -servers = ["nats://192.168.0.104:4222"] -subjects = ["swarm.heartbeat", "monitor.>"] - -[[rules]] -name = "high-cpu" -target = "*" -metric = "cpu.percent" -condition = { gt = 85.0 } -severity = "warn" -message = "{target}: CPU at {value:.0}%" - -[[rules]] -name = "critical-disk" -target = "*" -metric = "disk.used_pct" -condition = { gt = 90.0 } -severity = "critical" - -[notify] -terminal_bell = true -voice = true -voice_engine = "auto" -nats_subject = "monitor.alerts" -``` - -Config is searched in order: `MONITOR_CONFIG` env → `./monitor-agent.toml` -→ `~/.config/monitor-agent/config.toml` → `/etc/monitor-agent/config.toml` -→ built-in defaults. +See [`docs/CONFIGURATION.md`](docs/CONFIGURATION.md) for a complete +`monitor-agent.toml` combining targets, NATS, rules, and notify in one file. --- @@ -262,8 +215,7 @@ monitor-agent/ ## Roadmap -Next: Phase 11 — IPC socket daemon/TUI split (daemon runs as a background -service; TUI attaches on demand). See [`docs/ROADMAP.md`](docs/ROADMAP.md). +See [`docs/ROADMAP.md`](docs/ROADMAP.md) for current priorities. --- diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md new file mode 100644 index 0000000..3ca950e --- /dev/null +++ b/docs/CONFIGURATION.md @@ -0,0 +1,54 @@ +# Full configuration example + +Combines every section from the README (targets, NATS, alert rules, notify) +into one file. See the README for what each section does. + +```toml +[daemon] +socket = "" # default: $XDG_RUNTIME_DIR/monitor-agent.sock + +[[targets]] +name = "local" +kind = "local" + +[[targets]] +name = "gnuc" +kind = "prometheus" +endpoint = "http://192.168.0.104:9090" + +[[targets]] +name = "nuc" +kind = "ssh" +host = "192.168.0.104" +user = "hartsock" +key = "~/.ssh/id_ed25519" + +[nats] +servers = ["nats://192.168.0.104:4222"] +subjects = ["swarm.heartbeat", "monitor.>"] + +[[rules]] +name = "high-cpu" +target = "*" +metric = "cpu.percent" +condition = { gt = 85.0 } +severity = "warn" +message = "{target}: CPU at {value:.0}%" + +[[rules]] +name = "critical-disk" +target = "*" +metric = "disk.used_pct" +condition = { gt = 90.0 } +severity = "critical" + +[notify] +terminal_bell = true +voice = true +voice_engine = "auto" +nats_subject = "monitor.alerts" +``` + +Config is searched in order: `MONITOR_CONFIG` env → `./monitor-agent.toml` +→ `~/.config/monitor-agent/config.toml` → `/etc/monitor-agent/config.toml` +→ built-in defaults.