#!/usr/bin/env bash # Trouve-KA — vérification de santé du stack # Author: Simon-Pierre Boucher # Contact: contact@spboucher.ai set -uo pipefail API_URL="${API_URL:-http://localhost:8080}" SEARCH_URL="${SEARCH_URL:-http://localhost:9200}" WEB_URL="${WEB_URL:-http://localhost:3000}" FAIL=0 check() { local name="$1" url="$2" if curl -sf --max-time 5 "$url" > /dev/null; then echo "✓ $name ($url)" else echo "✗ $name ($url)" FAIL=1 fi } check "API santé" "$API_URL/api/health" check "API statut" "$API_URL/api/status" check "OpenSearch" "$SEARCH_URL/_cluster/health" check "Web" "$WEB_URL/" exit $FAIL