In Ubuntu, how to get email notifications about (software) RAID problems?
Add MAILADDR [email protected]
to /etc/mdadm/mdadm.conf
, then /etc/init.d/mdadm restart
or it'll just start on next boot. There's also a munin plugin if you're running munin with email alerts.
I found a nice tip closely related to my question, and wanted to share it:
TomTheGeek: Pop up notification of software RAID problems in Ubuntu
It's not about email notifications, but as the blog post says, pop-up notifications (like in screenshot below) might be even better when we're talking about a workstation.
I'll summarise the main points here (in case that blog ever disappears). This uses notify-send
, so you need to install notification-daemon
package. Basically you add this in /etc/mdadm/mdadm.conf
(along with MAILADDR
):
# display local notification
PROGRAM /usr/sbin/mdadm-notify.sh
...and the mdadm-notify.sh
script should be something like:
#!/bin/bash
#get dbus session
eval `dbus-launch --sh-syntax --exit-with-session`
#show alert
/usr/bin/notify-send -u critical -c device.error -i /usr/share/icons/Human/32x32/status/dialog-warning.png -t 0 "RAID Status" "<b>$2</b>: $1" -h int:x:1250 -h int:y:20