udda / multiload-ng

Modern graphical system monitor for any panel
http://udda.github.io/multiload-ng
GNU General Public License v2.0
146 stars 22 forks source link

Fix sysfs path detection for /dev/nvme* and /dev/dm-* #63

Open nylen opened 6 years ago

nylen commented 6 years ago

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.