#!/bin/bash # Elizabeth Training Monitoring Dashboard echo "=== Elizabeth Training Monitoring Dashboard ===" echo "Timestamp: $(date)" echo "" # Check training manager echo "📊 Training Manager Status:" if ps aux | grep -q "training_manager.py" | grep -v grep; then echo " ✅ RUNNING - Training manager active" MANAGER_PID=$(ps aux | grep "training_manager.py" | grep -v grep | awk '{print $2}') echo " PID: $MANAGER_PID" else echo " ❌ STOPPED - Training manager not running" fi echo "" # Check Elizabeth processes echo "🤖 Elizabeth Processes:" ELIZABETH_PROCS=$(ps aux | grep "python3.*elizabeth" | grep -v grep) if [ -n "$ELIZABETH_PROCS" ]; then echo "$ELIZABETH_PROCS" | while read line; do echo " ✅ $line" done COUNT=$(echo "$ELIZABETH_PROCS" | wc -l) echo " Total processes: $COUNT" else echo " ❌ No Elizabeth processes found" fi echo "" # Check logs echo "📋 Log Files:" LOG_FILES=$(ls -la /workspace/elizabeth_logs/ 2>/dev/null) if [ -n "$LOG_FILES" ]; then echo " Log directory: /workspace/elizabeth_logs/" echo " Files:" ls -la /workspace/elizabeth_logs/ | tail -5 | while read line; do echo " $line" done else echo " ❌ No log directory found" fi echo "" # Check training history echo "📈 Training History:" if [ -f "/workspace/elizabeth_logs/training_history.json" ]; then SESSIONS=$(jq '.total_sessions' /workspace/elizabeth_logs/training_history.json 2>/dev/null) RESTARTS=$(jq '.total_restarts' /workspace/elizabeth_logs/training_history.json 2>/dev/null) echo " Total sessions: ${SESSIONS:-0}" echo " Total restarts: ${RESTARTS:-0}" else echo " No training history found" fi echo "" # System status echo "🖥️ System Status:" CPU=$(top -bn1 | grep "Cpu(s)" | awk '{print $2}') MEM=$(free -m | awk '/Mem:/ {printf "%.1f%%", $3/$2*100}') echo " CPU Usage: $CPU%" echo " Memory Usage: $MEM" echo "" echo "=== Dashboard Refresh: $(date) ===" echo "Run this script periodically to monitor training status"