import os import sys import paramiko sys.stdout.reconfigure(encoding="utf-8") pkey = paramiko.Ed25519Key.from_private_key_file(os.path.expanduser('~/.ssh/id_ed25519_snarfnet')) nodes = [ ("aerodrome-ctl01", "140.44.4.11", "root"), ("aerodrome-ctl02", "140.44.4.12", "root"), ("aerodrome-ctl03", "140.44.4.13", "root"), ("aerodrome-wrk02", "140.44.4.22", "root"), ("aerodrome-wrk07", "140.44.4.27", "root"), ] for name, ip, user in nodes: client = paramiko.SSHClient() client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: client.connect(ip, username=user, pkey=pkey, timeout=5) stdin, stdout, stderr = client.exec_command("lsusb | grep -i sandisk || true") res = stdout.read().decode().strip() if res: print(f"Found SanDisk on {name} ({ip}): {res}") client.close() except Exception as e: pass