multiload-ng
multiload-ng copied to clipboard
Fix sysfs path detection for /dev/nvme* and /dev/dm-*
Before this PR, multiload_graph_disk_get_filter
and multiload_graph_disk_get_data
attempt to read from the following sysfs paths on my computer. Both are invalid, which leads to no devices or data in the disk graph:
/sys/block/nvme/nvme0n1p1/stat
/sys/block/dm-/dm-1/stat
After my changes, the block device prefixes are calculated correctly for nvme and dm- devices:
/sys/block/nvme0n1/nvme0n1p1/stat
/sys/block/dm-1/stat
There is probably a better way to get this sysfs path than by doing string manipulation, but I don't know it.