# -*- 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 [ "kubectl cluster-info 2>&1", "kubectl get nodes 2>&1", "docker ps -a --format '{{.Names}}' | grep -iE 'k3s|kind|minikube|gitlab|argocd' || true", "ls -la /opt/argocd-demo /opt/gitlab-demo 2>&1 || true", ]: print("===", cmd) _, o, e = c.exec_command(cmd, timeout=30) print(o.read().decode()) print(e.read().decode()) c.close()