#!/bin/bash # ROA2WEB Unified App - Services Status Overview # Shows status of all services (SSH Tunnel, Backends, Bot, Frontend) # Script directory SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Source helper functions source "$SCRIPT_DIR/scripts/service-helpers.sh" print_header "ROA2WEB Unified App - Services Status" # SSH Tunnel check echo -e "${BLUE}━━━ Infrastructure ━━━${NC}" if check_service_status 1526 "SSH Tunnel (Oracle)"; then : else print_warning "SSH Tunnel not running - Oracle DB connection will fail" print_info "Start with: ./ssh_tunnel.sh start" fi echo "" # Backend Reports echo -e "${BLUE}━━━ Reports Backend ━━━${NC}" if check_service_status 8001 "Reports Backend"; then # Try health check health=$(curl -s http://localhost:8001/health 2>&1 | head -20) if echo "$health" | grep -q "ok"; then print_success "Health check: OK" else print_warning "Health check: Not responding" fi else print_info "Start with: ./backend-reports.sh start" fi echo "" # Backend Data Entry echo -e "${BLUE}━━━ Data Entry Backend ━━━${NC}" if check_service_status 8003 "Data Entry Backend"; then # Try health check health=$(curl -s http://localhost:8003/health 2>&1 | head -20) if echo "$health" | grep -q "ok"; then print_success "Health check: OK" else print_warning "Health check: Not responding" fi else print_info "Start with: ./backend-data-entry.sh start" fi echo "" # Telegram Bot echo -e "${BLUE}━━━ Telegram Bot ━━━${NC}" if check_service_status 8002 "Telegram Bot"; then : else print_info "Start with: ./bot.sh start" fi echo "" # Frontend echo -e "${BLUE}━━━ Frontend Unified ━━━${NC}" if check_service_status 3000 "Frontend Unified"; then print_info "Access at: http://localhost:3000" else print_info "Start with: ./frontend.sh start" fi echo "" # Log files summary print_header "Log Files" echo -e "${BLUE}Recent logs (last modified):${NC}" ls -lht /tmp/*backend*.log /tmp/telegram-bot.log /tmp/vite-unified.log 2>/dev/null | head -10 || print_warning "No log files found" echo "" # Quick stats print_header "Quick Stats" running_count=0 for port in 1526 8001 8003 8002 3000; do if netstat -tuln 2>/dev/null | grep -q ":${port} " || ss -tuln 2>/dev/null | grep -q ":${port} "; then running_count=$((running_count + 1)) fi done echo -e "${BLUE}Services running: ${GREEN}${running_count}/5${NC}" if [ $running_count -eq 5 ]; then print_success "All services are running!" elif [ $running_count -ge 3 ]; then print_warning "Some services are not running" else print_error "Most services are offline" fi echo "" # Helpful commands echo -e "${BLUE}━━━ Helpful Commands ━━━${NC}" echo " ./status.sh # Show this status" echo " ./frontend.sh restart # Restart frontend (quick!)" echo " ./backend-reports.sh status # Detailed Reports backend status" echo " ./backend-data-entry.sh status # Detailed Data Entry status" echo " ./bot.sh status # Detailed bot status" echo " tail -f /tmp/vite-unified.log # Watch frontend logs" echo ""