On 09/10/24 at 21:10, Jochen Spieker wrote:
Andy Smith:Hi, On Wed, Oct 09, 2024 at 08:41:38PM +0200, Franco Martelli wrote:Do you know whether MD is clever enough to send an email to root when it fails the device? Or have I to keep an eye on /proc/mdstat?For more than a decade mdadm has shipped with a service that runs in monitor mode to do this. https://manpages.debian.org/bookworm/mdadm/mdadm.8.en.html#MONITOR_MODEAnd this is configured here: # grep -B1 MAILADDR /etc/mdadm/mdadm.conf # instruct the monitoring daemon where to send mail alerts MAILADDR root
Yes, I think I have mdadm running properly to achieve that: ~$ pstree -cpan|grep mdadm |-mdadm,459 --monitor --scan ~$ grep -B1 MAILADDR /etc/mdadm/mdadm.conf # instruct the monitoring daemon where to send mail alerts MAILADDR rootI asked this question because I was unsure. In the past it happened system freeze so I needed to hard reboot the the system, sometime this caused a "resync" of the array and no email was sent to root. A "resync" activity falls in the "RebuildStarted" mdadm's event. The man-page says:
...Only Fail, FailSpare, DegradedArray, SparesMissing and TestMessage cause Email to be sent.
...This explain why an email hadn't been sent from mdadm. Thank you very much Andy and Jochen.
Cheers, -- Franco Martelli