Files
2026-08-15 14:51:51 +08:00

20 lines
612 B
Python

import os, paramiko
pw = os.environ["DEPLOY_PASSWORD"]
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("20.191.152.26", username="wakka", password=pw, timeout=30)
cmds = [
"sudo docker ps -a",
"ss -tlnp | grep 7777 || true",
"curl -sI --max-time 20 http://127.0.0.1:7777/guest-customer-service | head -12",
"sudo docker logs guest-chat --tail 50 2>&1",
]
for cmd in cmds:
print("===", cmd)
_, o, e = c.exec_command(cmd, timeout=120)
print(o.read().decode())
err = e.read().decode()
if err:
print("ERR:", err[:800])
c.close()