Added nvme details #20

Merged
PeterSurda merged 2 commits from swapnil/idlers-agent:main into main 2024-07-01 16:39:46 +02:00
Showing only changes of commit 75744e0010 - Show all commits

View File

@ -157,7 +157,7 @@ class ServerData:
return devices return devices
# Get the list of nvme devices starting with 'nvme' # Get the list of nvme devices starting with 'nvme'
nvme_devices = [device for device in os.listdir('/dev') if device.startswith('nvme')] nvme_devices = [device for device in os.listdir('/sys/block') if device.startswith('nvme')]
PeterSurda marked this conversation as resolved Outdated

I think this will include the character device, block device, and partitions (and also /dev/nvme-fabrics which I don't even know what it is). A better option is to look in /sys/block/nvme*. That will only include the main block device (e.g. nvme0n1), and then you can join /dev/ and the file name.

I think this will include the character device, block device, and partitions (and also `/dev/nvme-fabrics` which I don't even know what it is). A better option is to look in `/sys/block/nvme*`. That will only include the main block device (e.g. `nvme0n1`), and then you can join `/dev/` and the file name.
for device in nvme_devices: for device in nvme_devices:
device_path = '/dev/' + device device_path = '/dev/' + device