diff --git a/ceph_osd_analyzer.py b/ceph_osd_analyzer.py index 2c534f5..d38f86f 100644 --- a/ceph_osd_analyzer.py +++ b/ceph_osd_analyzer.py @@ -162,6 +162,16 @@ def get_smart_data_remote(device_path, hostname): f"smartctl -a -j {device_path} -d nvme", # Try without sudo f"sudo smartctl -a -j {device_path}", ] + elif tran == "usb": + # USB-connected drives need special device type flags + commands_to_try = [ + f"sudo smartctl -a -j {device_path} -d sat", # SAT (SCSI-ATA Translation) + f"sudo smartctl -a -j {device_path} -d usbjmicron", # JMicron USB bridge + f"sudo smartctl -a -j {device_path} -d usbcypress", # Cypress USB bridge + f"sudo smartctl -a -j {device_path} -d usb", # Generic USB + f"sudo smartctl -a -j {device_path} -d scsi", # SCSI passthrough + f"sudo smartctl -a -j {device_path}", # Auto-detect + ] elif tran == "sata": commands_to_try = [ f"sudo smartctl -a -j {device_path}", @@ -169,10 +179,11 @@ def get_smart_data_remote(device_path, hostname): f"sudo smartctl -a -j {device_path} -d ata", ] else: - # Unknown or no transport, try generic approaches + # Unknown or no transport, try generic approaches including USB commands_to_try = [ f"sudo smartctl -a -j {device_path}", f"smartctl -a -j {device_path}", + f"sudo smartctl -a -j {device_path} -d sat", # Try USB/SAT f"sudo smartctl -a -j {device_path} -d auto", ] @@ -186,6 +197,7 @@ def get_smart_data_remote(device_path, hostname): if DEBUG: print(f"{Colors.RED}DEBUG: All SMART methods failed for {device_path} on {hostname}{Colors.END}") + print(f"{Colors.YELLOW}DEBUG: Transport type detected: {tran if tran else 'unknown'}{Colors.END}") return None