# -*- coding: utf-8 -*- import sys, time, paramiko sys.stdout.reconfigure(encoding="utf-8", errors="replace") c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect("108.174.50.68", 22, "root", "Xiao4669805", timeout=60, allow_agent=False, look_for_keys=False) for cmd in [ "systemctl is-active douyinweb-api douyinweb-s3 douyinweb-web", "curl -sS -o /dev/null -w 'health=%{http_code}\n' http://127.0.0.1:8014/api/health", "curl -sS -o /dev/null -w 'covers=%{http_code}\n' -k https://127.0.0.1/covers/ -H 'Host: dy.nomadro.live' -L", "curl -sS -o /dev/null -w 's3=%{http_code} sz=%{size_download}\n' http://127.0.0.1:8333/douyin-covers/covers/5d3e14cd-8c13-4b7c-9522-e44dc1cad31e.jpg", """SID=$(cd /opt/douyinWEB/backend && .venv/bin/python -c "from app import db; s=db.list_active_sessions(); print(s[0]['id'] if s else '')") curl -sS -o /dev/null -w "api_cover=%{http_code} sz=%{size_download}\n" "http://127.0.0.1:8014/api/sessions/$SID/cover" """, "grep -c 'anonymous' /etc/seaweedfs/douyinweb-s3.json || true", ]: print(">", cmd[:55]) i,o,e=c.exec_command(cmd, timeout=25) print(o.read().decode("utf-8","replace").strip()) c.close()