mirror of
git://f0xx.org/android_cast
synced 2026-07-29 05:37:52 +03:00
bumping
Net topology: sirene (P2P), spider (MCU), spider net (SFU), pautina (net, mesh), hydra (hybrid), code names
This commit is contained in:
@@ -2,6 +2,52 @@
|
||||
|
||||
Scripts for **router**, **FE**, and **external vantage** (e.g. Raspberry Pi) — not BE app hosts.
|
||||
|
||||
## Auto watchdog (v2.1)
|
||||
|
||||
When a cron snapshot exceeds thresholds, `wan-snapshot.sh` appends **alert** + **deep** lines to the same log (`WAN_WATCH_LOG`).
|
||||
|
||||
| `kind=` | Meaning |
|
||||
|---------|---------|
|
||||
| `snapshot` | Normal 15-min ping row |
|
||||
| `alert` | Threshold breached; lists `triggers=` |
|
||||
| `deep` | One parseable fact (`section=host`, `burst`, `iface`, `iptables`, …) |
|
||||
|
||||
**Deploy both files:**
|
||||
|
||||
```bash
|
||||
sudo cp examples/network/wan-snapshot.sh examples/network/wan-deep-diag.sh /usr/local/bin/
|
||||
sudo chmod +x /usr/local/bin/wan-snapshot.sh /usr/local/bin/wan-deep-diag.sh
|
||||
```
|
||||
|
||||
**Env** (`/etc/conf.d/wan-snapshot`):
|
||||
|
||||
```sh
|
||||
WAN_WATCH_LOG=/var/log/wan-watch.log
|
||||
WAN_SNAPSHOT_LOG=/var/log/wan-watch.log
|
||||
WAN_SNAPSHOT_WATCH=1
|
||||
```
|
||||
|
||||
**Triggers (defaults):** `*_avg_ms >= 50`, `*_loss >= 1%`, `mdev >= 80`, `conntrack >= 80%`, `neigh_fe` not REACHABLE/DELAY, plus role hints `pi_fe_path` / `router_wan_path`.
|
||||
|
||||
**Cooldown:** one deep capture per 14 min (`WAN_WATCH_COOLDOWN_S=840`) to avoid cron pile-up.
|
||||
|
||||
**Review after a bad spell:**
|
||||
|
||||
```bash
|
||||
/usr/local/bin/wan-snapshot.sh --alerts 80
|
||||
/usr/local/bin/wan-snapshot.sh --correlate /var/log/wan-watch.log …
|
||||
grep 'kind=deep.*section=burst' /var/log/wan-watch.log | tail
|
||||
grep 'kind=deep.*section=iptables' /var/log/wan-watch.log | tail
|
||||
```
|
||||
|
||||
Example deep lines:
|
||||
|
||||
```text
|
||||
kind=alert ts=2026-06-12T21:45:01+03:00 role=router host=monstro parent_ts=... triggers="wan_avg=535.365,router_wan_path"
|
||||
kind=deep ts=2026-06-12T21:45:01+03:00 role=router host=monstro parent_ts=... section=burst label=wan target=1.1.1.1 loss=0% avg_ms=520 max_ms=790 mdev_ms=110
|
||||
kind=deep ts=2026-06-12T21:45:01+03:00 role=router host=monstro parent_ts=... section=iptables tbl=filter chain=FORWARD line=3 pkts=188000 target=ACCEPT
|
||||
```
|
||||
|
||||
## `wan-snapshot.sh` (v2)
|
||||
|
||||
Periodic ping comparison plus lightweight host/path context.
|
||||
|
||||
Reference in New Issue
Block a user