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
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 | โ |