import paramiko import sys sys.stdout.reconfigure(encoding='utf-8') key_path = r"C:\Users\Snarf\.ssh\id_ed25519_snarfnet" client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.connect("140.44.4.41", username="root", key_filename=key_path, timeout=10) cmds = [ "k3s kubectl -n cattle-system get pods -o wide", "k3s kubectl -n cattle-system describe pod -l app=cattle-cluster-agent", "k3s kubectl get events -A --sort-by='.lastTimestamp' | tail -n 20" ] for cmd in cmds: print(f"\n==========================================") print(f">>> Running on Spaceport: {cmd}") print(f"==========================================") stdin, stdout, stderr = client.exec_command(cmd) print(stdout.read().decode('utf-8')) err = stderr.read().decode('utf-8') if err: print("STDERR:", err) client.close()