radiorabe/rabe-zabbix

MD-RAID: list spare disks

danboid opened this issue · 1 comments

It would be useful if the MD-RAID template reported the number of spare disks available.

Thanks for the input @danboid.

Do you have any suggestion on how to easily get the numbers of spare devices of a given MD RAID?

Each device has a state (/sys/block/<MD-NAME>/md/<RD-NAME>/state), which can be spare and is already available in the State of MD {#MD_RAID_RAID_DEV_NAME} RD {#MD_RAID_COMPONENT_DEV_NAME} device item.

However, there seems to be no single file within sysfs (/sys) which lists the number of spares, as it is the case for the number of degraded devices (/sys/block/<MD-NAME>/md/degraded).

One could write a custom user parameter which counts the number of spare drives with the help of a script or some shell tooling magic. But there might be a more elegant solution.