ligbox-ops-platform/specs/035-ligbox-watchman/quickstart.md
Ligbox Spec Hub c1881f58e6 chore: sync Console SSO, DNS viewer, specs e infra docs pendentes
Inclui console handoff Desk↔Console (Spec 019), melhorias DNS Viewer (037),
OpenPanel/Nextcloud/VM116 deploy notes, contracts stack e sidebar actualizado.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 20:10:17 +00:00

81 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Quickstart — Ligbox Watchman (Spec 035)
**Público:** ops_lead, super_admin
**Host alvo:** VM122 (`10.10.10.122`)
---
## Pré-requisitos
- Repo em `/opt/ligbox-ops-platform` (git pull Forgejo)
- Python 3.11+
- Acesso LAN a VMs 112/114/123/130
- Tópico ntfy criado (ex.: `ligbox-watchman`)
---
## 1. Mitigação imediata (Docker restart)
```bash
cd /opt/ligbox-ops-platform
# Adicionar restart: unless-stopped em api, frontend, worker, redis
docker-compose -f docker-compose.mvp.yml up -d
```
---
## 2. Instalar Watchman (após implementação Fase 1)
```bash
cd /opt/ligbox-ops-platform
sudo ./deploy/watchman/install.sh
sudo cp deploy/watchman/watchman.env.example /etc/ligbox-watchman/env
sudo nano /etc/ligbox-watchman/env # NTFY_URL, tópico, email
sudo systemctl enable --now ligbox-watchman
```
---
## 3. Verificar
```bash
systemctl status ligbox-watchman
journalctl -u ligbox-watchman -f
cat /var/lib/ligbox-watchman/status.json | python3 -m json.tool
```
---
## 4. Teste de alerta (staging)
```bash
docker stop ligbox-ops-platform_frontend_1
# Esperar ~60s (2× critical 30s) → ntfy DOWN
docker start ligbox-ops-platform_frontend_1
# Esperar ~60s → ntfy RESOLVED
```
---
## Variáveis (`/etc/ligbox-watchman/env`)
```env
WATCHMAN_CATALOG=/opt/ligbox-ops-platform/contracts/stack-services.yaml
WATCHMAN_STATE_DIR=/var/lib/ligbox-watchman
NTFY_URL=https://ntfy.ligbox.com.br
NTFY_TOPIC=ligbox-watchman
NTFY_TOKEN=
ALERT_EMAIL=admin@ligbox.com.br
SMTP_HOST=127.0.0.1
SMTP_PORT=25
FAILURES_BEFORE_ALERT=2
```
---
## Rollback
```bash
sudo systemctl stop ligbox-watchman
sudo systemctl disable ligbox-watchman
```