Skip to content

Observability: mr doctor, event log and notifications (#16) - #74

Merged
Cd1s merged 1 commit into
mainfrom
feat/observability
Sep 25, 2026
Merged

Cd1s merged 1 commit into
mainfrom
feat/observability

Conversation

@Cd1s

@Cd1s Cd1s commented Sep 25, 2026

Copy link
Copy Markdown
Owner

What

  • mr doctor runs fixed, read-only checks for configuration and guard, pending changes, WAN and routes, DNS, IPv6 delegation, flow offload, services, WiFi, clock/NTP, storage, memory, conntrack, crash records and SSH password login. It is available through CLI and sys.doctor; the last result appears in mr status and the web UI.
  • A bounded flash-backed event log records WAN transitions, apply/rollback results, login locks, boot/shutdown, firmware and health findings. Events are cleaned and capped before writing.
  • Notification channels support Telegram and generic webhooks with cursors, retry backoff, hourly rate limits and quiet hours. Notification flushing is event-triggered and periodic checks reuse the existing minute sampler; no resident daemon is added.
  • Notification secrets never appear in state, logs, status or API responses.

Why

The router needs a small, durable record of what happened and a safe first diagnostic command when the web UI or WAN is unhealthy. The implementation keeps the existing one-shot process model.

Verification

  • Private and public tools/ci.sh pass on the remote build host.
  • Unit tests cover doctor findings, event trimming, event deduplication, notification validation, payload cleaning and retry/cursor behavior.

Closes #16

https://claude.ai/code/session_01HWeUjo1dmS7gBkCYHrVjCr

…lth checks

- `mr doctor` runs fixed read-only checks for config, pending changes, WAN/routes/DNS/IPv6, offload,
  services, WiFi, clock, storage, memory, conntrack, crashes and SSH; CLI/API/UI consume the result.
- A small flash-backed event log records WAN transitions, apply/rollback, login locks, boot and health
  findings. It is bounded and writes only on events.
- Telegram and generic webhook notifications use cursors, retry backoff, rate limits and quiet hours;
  no resident daemon is added. Periodic doctor runs are driven by the existing minute sampler.

Closes #16
@Cd1s
Cd1s merged commit 1d143eb into main Sep 25, 2026
2 checks passed
@Cd1s
Cd1s deleted the feat/observability branch September 25, 2026 20:32
Cd1s added a commit that referenced this pull request Sep 26, 2026
…ests, CI, docs, web UI (#77)

#74 shipped the event log, notifications and `mr doctor` without their triggers: `mr event tick` was
never run and `mr event boot` / `shutdown` were not called. Now:

- mr-mon's sampler starts `mr event tick` (detached) when the lease file changed or event.due came;
  mr-bootlog runs `mr event boot` at start and `mr event shutdown` only when the system goes down.
- NTP "synced" marker in /run/mr-clock (clock-save): busybox ntpd never lowers the kernel's maxerror.
- Fixes: the AX6000's watchdog boot line is no crash; event numbering continues after a torn last
  line; per-type limit of 10 events an hour, append-only device list, bursts of new devices in one
  line; WAN drops during an apply / rollback / scheduled redial are info; secrets are removed before
  error text is shortened; the background doctor does not turn deliberate settings into events; one
  background sender per burst.
- Doctor: a WAN address inside a LAN subnet is a risk. MCP monitor views: events, doctor.
- Web UI: 状态 › 体检与事件 (体检 / 事件 / 通知, test send per channel); overview 问题 / 最近事件.
- Tests for events, notifications, doctor; CI with a local webhook, real net hooks, the sampler.
- Docs: sys.md, mon.md, MODULES.md, api.md, mcp.md, skill.

Closes #16

Claude-Session: https://claude.ai/code/session_01HWeUjo1dmS7gBkCYHrVjCr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

提议:可观测与告警(事件通知、mr doctor、探测升级、route check)

1 participant