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()) spaceport_nodes = [ ('sninfr0lnxctl01', '140.44.4.41'), ('sninfr0lnxctl02', '140.44.4.42'), ('sninfr0lnxctl03', '140.44.4.43'), ('sninfr0lnxctl04', '140.44.4.44'), ('sninfr0lnxwrk01', '140.44.4.51'), ('sninfr0lnxwrk02', '140.44.4.52'), ('sninfr0lnxwrk03', '140.44.4.53'), ('sninfr0lnxwrk04', '140.44.4.54'), ('sninfr0lnxwrk05', '140.44.4.55'), ('sninfr0lnxwrk06', '140.44.4.56'), ] print(f"{'NODE':<18} {'IP':<15} {'RUNNING KERNEL':<22} {'LATEST MODULES':<25} {'VETH LOADED':<12} {'UPTIME'}") print("="*105) for name, ip in spaceport_nodes: try: client.connect(ip, username="root", key_filename=key_path, timeout=5) stdin, stdout, stderr = client.exec_command("uname -r; ls -1 /lib/modules | sort -V | tail -n 1; lsmod | grep -q veth && echo YES || echo NO; uptime -p") lines = [l.strip() for l in stdout.read().decode('utf-8').strip().split('\n') if l.strip()] running_k = lines[0] if len(lines) > 0 else "?" latest_mod = lines[1] if len(lines) > 1 else "?" veth = lines[2] if len(lines) > 2 else "?" uptime_str = lines[3] if len(lines) > 3 else "?" print(f"{name:<18} {ip:<15} {running_k:<22} {latest_mod:<25} {veth:<12} {uptime_str}") client.close() except Exception as e: print(f"{name:<18} {ip:<15} ERROR: {e}")