#!/usr/bin/env python3 import paramiko c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect("192.168.110.207", username="root", password="123456") cmds = [ "ss -tlnp | grep -E '9091|3001|8781' || true", "docker ps -a --filter name=hw8 --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}'", "curl -sf http://127.0.0.1:9997/v1/models | head -c 300 || echo XF_FAIL", ] for cmd in cmds: print("===", cmd, "===") _, o, e = c.exec_command(cmd) print(o.read().decode()) err = e.read().decode() if err: print(err) c.close()