app:
layouts:
- id: 'devops_control_center'
root: true
title: 'DevOps Control Center'
bg_color: 'black'
fg_color: 'bright_white'
selected_fg_color: 'black'
selected_bg_color: 'bright_blue'
border_color: 'bright_blue'
selected_border_color: 'bright_cyan'
title_fg_color: 'bright_cyan'
title_bg_color: 'black'
children:
- id: 'header'
title: 'DevOps Control Center - System Overview'
position:
x1: "0%"
y1: "0%"
x2: "100%"
y2: "8%"
border_color: 'bright_cyan'
bg_color: 'black'
fg_color: 'bright_cyan'
refresh_interval: 2000
script:
- "echo 'Host: $(hostname) | User: $(whoami) | Load: $(uptime | cut -d: -f4- | cut -d, -f1) | Time: $(date \"+%Y-%m-%d %H:%M:%S\")'"
- id: 'service_control'
title: 'Service Management'
position:
x1: "1%"
y1: "10%"
x2: "20%"
y2: "95%"
tab_order: 1
border_color: 'green'
choices:
- id: 'docker_status'
content: 'Docker Status'
script:
- "echo 'Docker Container Status:'"
- "if command -v docker >/dev/null 2>&1; then docker ps --format 'table {{.Names}}\t{{.Status}}' | head -10; else echo 'Docker not available'; fi"
redirect_output: 'main_output'
- id: 'nginx_status'
content: 'Nginx Status'
script:
- "echo 'Nginx Service Status:'"
- "if command -v systemctl >/dev/null 2>&1; then systemctl status nginx --no-pager -l; elif command -v brew >/dev/null 2>&1; then brew services list | grep nginx; else echo 'Service management not available'; fi"
redirect_output: 'main_output'
- id: 'database_check'
content: 'Database Check'
script:
- "echo 'Database Connection Tests:'"
- "echo 'PostgreSQL: $(if command -v psql >/dev/null 2>&1; then echo \"Available\"; else echo \"Not installed\"; fi)'"
- "echo 'MySQL: $(if command -v mysql >/dev/null 2>&1; then echo \"Available\"; else echo \"Not installed\"; fi)'"
- "echo 'Redis: $(if command -v redis-cli >/dev/null 2>&1; then echo \"Available\"; else echo \"Not installed\"; fi)'"
redirect_output: 'main_output'
- id: 'process_monitor'
content: 'Process Monitor'
script:
- "echo 'Top Resource Consuming Processes:'"
- "ps aux --sort=-%cpu | head -15 | awk '{printf \"%-20s %s%%\\n\", $11, $3}'"
redirect_output: 'main_output'
- id: 'port_scan'
content: 'Port Status'
script:
- "echo 'Active Network Ports:'"
- "if command -v netstat >/dev/null 2>&1; then netstat -tlnp 2>/dev/null | head -10; else echo 'netstat not available'; fi"
- "echo ''"
- "echo 'Common ports check:'"
- "for port in 22 80 443 3306 5432 6379; do if nc -z localhost $port 2>/dev/null; then echo \"Port $port: OPEN\"; else echo \"Port $port: CLOSED\"; fi; done"
redirect_output: 'main_output'
- id: 'main_output'
title: 'Command Output'
position:
x1: "22%"
y1: "10%"
x2: "60%"
y2: "60%"
border_color: 'yellow'
bg_color: 'black'
fg_color: 'bright_white'
content: "Select a service from the left box to view details"
- id: 'metrics_box'
title: 'System Metrics'
position:
x1: "62%"
y1: "10%"
x2: "99%"
y2: "60%"
border_color: 'magenta'
refresh_interval: 3000
script:
- "echo 'SYSTEM RESOURCES'"
- "echo '================'"
- "echo ''"
- "echo 'CPU Usage:'"
- "if command -v top >/dev/null 2>&1; then top -l1 -n0 | grep 'CPU usage' | head -1; else echo 'Load: '$(uptime | cut -d: -f4-); fi"
- "echo ''"
- "echo 'Memory:'"
- "if command -v free >/dev/null 2>&1; then free -h | grep -E 'Mem|Swap'; else vm_stat | head -5; fi"
- "echo ''"
- "echo 'Disk Usage:'"
- "df -h / | tail -1"
- "echo ''"
- "echo 'Network Interfaces:'"
- "ifconfig | grep -E '^[a-z]' | cut -d: -f1 | head -3"
- id: 'log_monitor'
title: 'Live Logs'
position:
x1: "22%"
y1: "62%"
x2: "99%"
y2: "95%"
border_color: 'red'
bg_color: 'black'
fg_color: 'bright_yellow'
refresh_interval: 5000
script:
- "echo 'RECENT SYSTEM EVENTS'"
- "echo '==================='"
- "echo ''"
- "if [ -f /var/log/syslog ]; then"
- " echo 'System Log (last 8 lines):'"
- " tail -8 /var/log/syslog 2>/dev/null || echo 'Access denied'"
- "elif [ -f /var/log/system.log ]; then"
- " echo 'System Log (last 8 lines):'"
- " tail -8 /var/log/system.log 2>/dev/null || echo 'Access denied'"
- "else"
- " echo 'Simulated log entries:'"
- " echo \"$(date): INFO Application started successfully\""
- " echo \"$(date): WARN High memory usage detected\""
- " echo \"$(date): INFO Database connection established\""
- " echo \"$(date): INFO Backup process completed\""
- "fi"
- id: 'quick_actions'
title: 'Quick Actions'
position:
x1: "1%"
y1: "62%"
x2: "20%"
y2: "95%"
tab_order: 2
border_color: 'bright_red'
choices:
- id: 'system_info'
content: 'System Info'
script:
- "echo 'SYSTEM INFORMATION'"
- "echo '=================='"
- "echo 'OS: '$(uname -s -r)"
- "echo 'Architecture: '$(uname -m)"
- "echo 'Hostname: '$(hostname)"
- "echo 'Uptime: '$(uptime | cut -d, -f1 | cut -d' ' -f4-)"
- "echo 'Shell: '$SHELL"
- "echo 'Terminal: '$TERM"
redirect_output: 'main_output'
- id: 'disk_usage'
content: 'Disk Analysis'
script:
- "echo 'DISK USAGE ANALYSIS'"
- "echo '=================='"
- "df -h"
- "echo ''"
- "echo 'Largest directories:'"
- "du -sh /usr /var /opt /home 2>/dev/null | sort -hr | head -5"
redirect_output: 'main_output'
- id: 'network_test'
content: 'Network Test'
script:
- "echo 'NETWORK CONNECTIVITY'"
- "echo '=================='"
- "echo 'Testing connectivity...'"
- "if ping -c 1 8.8.8.8 >/dev/null 2>&1; then echo 'Internet: CONNECTED'; else echo 'Internet: DISCONNECTED'; fi"
- "if ping -c 1 github.com >/dev/null 2>&1; then echo 'GitHub: REACHABLE'; else echo 'GitHub: UNREACHABLE'; fi"
- "echo 'Local IP: '$(hostname -I 2>/dev/null | cut -d' ' -f1 || echo 'N/A')"
redirect_output: 'main_output'
- id: 'security_check'
content: 'Security Scan'
script:
- "echo 'SECURITY STATUS'"
- "echo '==============='"
- "echo 'Active SSH connections:'"
- "who | wc -l | xargs echo 'Users logged in:'"
- "echo 'Failed login attempts (last 24h):'"
- "if [ -f /var/log/auth.log ]; then grep 'Failed password' /var/log/auth.log | tail -5 2>/dev/null | wc -l; else echo 'N/A'; fi"
- "echo 'Listening services:'"
- "if command -v ss >/dev/null 2>&1; then ss -tlnp | wc -l; else netstat -tln 2>/dev/null | wc -l; fi | xargs echo 'Open ports:'"
redirect_output: 'main_output'