# -*- coding: utf-8 -*- import paramiko c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect("192.168.110.207", username="root", password="123456", timeout=20) for cmd in [ "tail -30 /opt/argocd-demo/install.log 2>/dev/null || echo 'no log yet'", "docker ps --format '{{.Names}} {{.Status}}' | grep -E 'gitlab|k3s' || true", "command -v k3s && k3s kubectl get nodes 2>/dev/null || true", ]: print("===", cmd[:70]) _, o, _ = c.exec_command(cmd, timeout=30) print(o.read().decode()) c.close()