docs: Layer 3 模拟巡检告警验证报告
Nexus CI/CD / test (push) Waiting to run
Nexus CI/CD / deploy (push) Blocked by required conditions
Nexus Pre-commit Checks / quick-check (push) Waiting to run

记录 flock 失败计数 bug 修复与 iptables 演练结果。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nexus Agent
2026-06-07 20:56:21 +08:00
parent 764703d401
commit ca0de7d04d
@@ -71,3 +71,30 @@
| cron `nexus-health-monitor` | ✓ 运行中 |
**Layer 3 巡检 Telegram 闭环已就绪。** /health 连续失败时将能推送 Telegram 并自动重启。
---
## 模拟巡检告警(2026-06-07
### 发现与修复
| 项 | 说明 |
|----|------|
| Bug | `bump_fail_count``flock` 子 shell 内递增,`FAIL` 恒为 0,永不触发重启/Telegram |
| Fix | `764703d` — 子 shell 写文件后 `cat` 回传计数 |
| 部署 | 已上线生产 |
### 演练(iptables 阻断 127.0.0.1:8600,容器保持运行)
| 步骤 | 结果 |
|------|------|
| run1 / run2 | fail=1 → fail=2 |
| run3 | fail=3`last_restart` 已写入,**docker restart 执行** |
| 解除阻断后 | `/health` ok,容器 `Up (healthy)` |
**Telegram**:第 3 次失败应已推送「连续 3 次无响应 / 正在自动重启」及「已恢复」类消息(请用户在 Telegram 确认)。
### 注意
- `docker pause` 不适合演练:`docker exec` 无法读 Telegram 配置
- 演练方式:阻断宿主机 localhost 端口或真实进程故障(容器仍 Running)