#!/usr/bin/env bash [ -f .env ] && source .env GREEN='\033[0;32m'; RED='\033[0;31m'; YELLOW='\033[1;33m'; BLUE='\033[0;34m'; NC='\033[0m' chk_http() { local name=$1 url=$2 code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 4 "$url" 2>/dev/null || echo "000") [[ "$code" =~ ^(200|204)$ ]] \ && echo -e " ${GREEN}●${NC} $name" \ || echo -e " ${RED}●${NC} $name (HTTP $code)" } chk_container() { local name=$1 status=$(docker inspect --format='{{.State.Status}}' "$name" 2>/dev/null || echo "없음") [ "$status" = "running" ] \ && echo -e " ${GREEN}●${NC} $name" \ || echo -e " ${RED}●${NC} $name ($status)" } echo "" echo -e "${BLUE}══ Trading AI Status ══════════════════════${NC} $(date '+%Y-%m-%d %H:%M:%S')" echo -e "\n${BLUE}[컨테이너]${NC}" for c in trading-redis trading-qdrant trading-bareun trading-bareunaapi \ trading-ollama trading-vllm trading-n8n trading-n8n-worker; do chk_container "$c" done echo -e "\n${BLUE}[서비스]${NC}" chk_http "Redis" "http://localhost:6379" chk_http "Qdrant" "http://localhost:6333/healthz" chk_http "Bareun" "http://localhost:9902/health" chk_http "바른API" "http://localhost:5757/health" chk_http "Ollama" "http://localhost:11434/api/tags" chk_http "vLLM" "http://localhost:8000/health" chk_http "n8n" "http://localhost:5678/healthz" echo -e "\n${BLUE}[GPU]${NC}" nvidia-smi --query-gpu=index,name,utilization.gpu,memory.used,memory.total,temperature.gpu \ --format=csv,noheader 2>/dev/null | \ while IFS=, read -r i n u mu mt t; do echo " GPU$i $n | 사용률:$u | VRAM:$mu/$mt | 온도:$t" done echo -e "\n${BLUE}[NFS]${NC}" mountpoint -q /mnt/nas 2>/dev/null \ && echo -e " ${GREEN}●${NC} /mnt/nas (마운트됨)" \ || echo -e " ${RED}●${NC} /mnt/nas (마운트 안됨)" echo ""