#!/usr/bin/env python3 import paramiko import sys sys.stdout.reconfigure(encoding="utf-8", errors="replace") def one(host, port, user, pw, cmd, t=60): c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect(host, port, user, pw, timeout=30, allow_agent=False, look_for_keys=False) _i, o, e = c.exec_command(cmd, timeout=t) out = (o.read() + e.read()).decode("utf-8", "replace") c.close() return out print("=== VPS ===", flush=True) print(one("107.173.30.245", 22, "root", "Xiao4669805", "systemctl is-active douyinweb-api; " "systemctl is-active dy-frp-http-aux sing-box frpp 'wg-quick@wg-dy'; " "curl -sS -m 15 -o /dev/null -w 'dylive=%{http_code}\\n' https://dylive.nomadro.com/api/health; " "curl -sS -m 15 -o /dev/null -w 'dy=%{http_code}\\n' https://dy.nomadro.com/api/health; " "curl -sS -m 15 -o /dev/null -w 'ops=%{http_code}\\n' https://dy.nomadro.com/ops-neko/1/; " "ss -lntp | grep -E '18200|14015|18014' | head -5", 90), flush=True) print("=== CN ===", flush=True) print(one("82.157.112.245", 22, "ubuntu", "Xiao4669805", "curl -sS -m 12 -o /dev/null -w 'cn_ops=%{http_code}\\n' https://dy.nomadro.cn/ops-neko/1/; " "curl -sS -m 12 -o /dev/null -w 'cn_api=%{http_code}\\n' https://dy.nomadro.cn/api/health; " "sudo iptables -t nat -S | grep -E '62300|OPS-NEKO' | head -6", 40), flush=True) print("=== PHYS chrome ===", flush=True) print(one("107.173.30.245", 4014, "eric", "4669805", "echo '4669805' | sudo -S -p '' docker exec douyinweb-ops-neko-1 supervisorctl status google-chrome; " "echo '4669805' | sudo -S -p '' curl -sS -m 5 -o /dev/null -w 'ops=%{http_code}\\n' http://127.0.0.1:18200/; " "echo '4669805' | sudo -S -p '' systemctl is-active douyinweb-api", 40), flush=True)