๐Ÿ“RAID Monitoring and Email Alerts Configuration for mdadm on AlmaLinux 9 / CloudLinux 9

This guide explains how to configure RAID monitoring and email alerts using mdadm on AlmaLinux 9 and CloudLinux 9 systems.


๐Ÿ“ Edit the mdadm Configuration File

On AlmaLinux 9 and CloudLinux 9, the configuration file is usually:

/etc/mdadm.conf

Open the File

vi /etc/mdadm.conf

If it doesnโ€™t exist, you can create it manually.


โš™๏ธ Required Configuration Entries

Add or ensure the following lines are present:

DEVICE partitions
MAILADDR [email protected],[email protected]
MAILFROM [email protected]

Important: No spaces between email addresses and commas in MAILADDR.


๐Ÿ“ค Install Required Mail Agent (Sendmail or Postfix)

To send RAID alerts, install a Mail Transfer Agent (MTA). Choose Sendmail or Postfix.

Option A โ€“ Install Sendmail

dnf install sendmail sendmail-cf -y
systemctl enable --now sendmail

Option B โ€“ Install Postfix (Recommended for newer systems)

dnf install postfix -y
systemctl enable --now postfix

Ensure your system hostname and /etc/hosts are configured correctly so the MTA works reliably.


๐Ÿ” Enable and Start RAID Monitoring Service

Use mdmonitor to manage the RAID monitoring service:

systemctl enable --now mdmonitor

This ensures that RAID monitoring starts on boot and runs immediately.


๐Ÿงช Test Email Alerts

Trigger a test alert with the following:

/sbin/mdadm --monitor --scan --test

This will send a test notification email to the address(es) in your MAILADDR entry.

โœ… Check mail logs in /var/log/maillog or /var/log/messages to confirm email was sent.


๐Ÿ”’ Firewall and Outbound Mail

Ensure that your firewall and hosting provider allow outbound email traffic on:

  • Port 25 (SMTP)
  • Port 587 (submission)

Some cloud providers block outbound mail by defaultโ€”check your providerโ€™s policies.


โœ… Summary Checklist

TaskStatus
mdadm configured with MAILADDR and MAILFROMโœ…
MTA (Sendmail/Postfix) installed and runningโœ…
mdmonitor service enabled and activeโœ…
Email test executed via --testโœ…
Mail delivery verified via logsโœ…
Scroll to Top