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 your@email.com,admin@yourdomain.com
MAILFROM raidalerts@yourdomain.com
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/maillogor/var/log/messagesto 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
| Task | Status |
|---|---|
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 | ✅ |
