import paramiko import sys sys.stdout.reconfigure(encoding='utf-8') key_path = r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet' def run_ssh(host, cmd): print(f"=== SSH {host}: {cmd} ===") ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: ssh.connect(host, username='snarf', key_filename=key_path, timeout=10) stdin, stdout, stderr = ssh.exec_command(cmd) out = stdout.read().decode('utf-8', errors='replace') err = stderr.read().decode('utf-8', errors='replace') if out: print(out) if err: print("STDERR:", err) except Exception as e: print(f"Error connecting to {host}: {e}") finally: ssh.close() # Check Spaceport (140.44.4.41) Pi-hole pod, service, secret run_ssh('140.44.4.41', "sudo kubectl get pods -n dns -o wide; sudo kubectl get svc -n dns -o wide") run_ssh('140.44.4.41', "sudo kubectl get secret -n dns -o yaml | grep -E 'name:|WEBPASSWORD|password'")