Files
storyforge/scripts/status_business.sh

24 lines
619 B
Bash
Executable File

#!/bin/sh
set -eu
ROOT="$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)"
COMPOSE_FILE="$ROOT/docker-compose.yml"
cd "$ROOT"
docker compose -f "$COMPOSE_FILE" ps
echo "---"
python3 - <<'PY'
import urllib.request
for name, url in [
("collector", "http://127.0.0.1:8081/healthz"),
("n8n", "http://127.0.0.1:5670/healthz"),
("cli-proxy-api", "http://127.0.0.1:8317/v1/models"),
]:
try:
with urllib.request.urlopen(url, timeout=5) as resp:
print(f"{name}: {resp.status} {resp.read().decode('utf-8', 'ignore')[:200]}")
except Exception as exc:
print(f"{name}: ERROR {exc}")
PY