Hi,

On Tue, Dec 24, 2024 at 03:45:31PM +0100, Roger Price wrote:
> I would like to scan /proc/mdstat and set a flag if [U-], [-U] or [--]
> occur.

Others have pointed out your '-' vs '_' confusion. But are you sure you
wouldn't rather just rely on the "mdadm --monitor" command that emails
you when devices are dropped? On Debian it's run by the "mdmonitor"
systemd service.

Failing that you can regularly check the
/sys/class/block/mdX/md/degraded file and if it's anything but 0 only
then look at other files under there or at /proc/mdstat.

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting

Reply via email to