This commit is contained in:
2026-05-14 23:30:34 +03:00
parent 26cb65e936
commit 04c46042d9
239 changed files with 34102 additions and 438 deletions
+35
View File
@@ -0,0 +1,35 @@
# RAP host-agent monitor
`rap-host-agent monitor-loop` is the local watchdog that runs near a node host.
It complements the update loop:
- starts watched Docker containers when they are stopped;
- restarts watched containers when Docker health is `unhealthy`;
- restarts containers stuck in `restarting` longer than the stale threshold;
- rate-limits repeated remediation with a restart cooldown;
- watches disk pressure and runs safe cleanup when the cleanup threshold is reached;
- removes old `/tmp/rap-*` and `/tmp/go-build*` build directories;
- writes an optional JSON status file;
- reports monitor status to the control plane through the node update-status channel.
Example:
```bash
rap-host-agent monitor-loop \
--backend-url http://127.0.0.1:18121/api/v1 \
--cluster-id cfc0743d-d960-49fb-9de8-96e063d5e4aa \
--node-id 108a0d66-d65e-4dea-b9a8-135366bf7dba \
--current-version 0.2.261-vpnfarm \
--interval-seconds 60 \
--disk-warn-percent 80 \
--disk-cleanup-percent 85 \
--disk-critical-percent 95 \
--status-file /tmp/rap-web-admin/html/downloads/ops/host-monitor-status.json \
--watch-container rap_test_postgres \
--watch-container rap_test_redis \
--watch-container rap_test_backend
```
On the shared test Docker host the current public status file is:
`http://docker-test.cin.su:18080/downloads/ops/host-monitor-status.json`