scripts/nym: status.sh probe container and HTTP API

This commit is contained in:
Hernâni Marques 2026-07-16 15:55:54 +02:00
parent 4b6038ae68
commit 0f343eba5b

13
scripts/nym/status.sh Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
# Probe koopa-nym container + local HTTP API
set -euo pipefail
HTTP="${NYM_HTTP:-http://127.0.0.1:9080}"
echo "=== podman ==="
podman ps -a --filter name=koopa-nym --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' || true
echo "=== listen ==="
ss -lntp 2>/dev/null | grep -E '9080|1789|1790|19000|51822' || true
echo "=== api /roles ==="
curl -sS -m 5 "${HTTP}/api/v1/roles" 2>/dev/null | head -c 500 || echo "(unreachable)"
echo
echo "=== api /health (if present) ==="
curl -sS -m 3 -o /dev/null -w "http=%{http_code}\n" "${HTTP}/api/v1/health" 2>/dev/null || true