Setting up e-mail notifications for Linux Software RAID

From csml-wiki.northwestern.edu
Revision as of 09:07, 19 March 2018 by Administrator (talk | contribs)
Jump to navigation Jump to search

It is prudent to set up email notifications that alert you when a RAID is in a degraded state. For a Software RAID on Linux (/dev/md partitions) this is done as follows.

  • openSuSE 13.1
  1. Go to YaST -> System -> /etc/sysconfig editor
  2. Within the sysconfig editor, select: System -> File systems -> Mdadm
  3. Set MDADM_MAIL (this can be a comma-separated list, for truly old versions of openSuSE, such as 11.1, it must be a single email address)
  4. Set MDADM_SEND_MAIL_ON_START to 'yes'
  5. Click 'Ok' and quit YaST
  6. From the command line do
    insserv mdadmd
    /etc/rc.d/mdadmd start
    
  7. You should receive a test email for each RAID partition.
  • openSuSE Leap 42.1
  1. Go to YaST -> System -> /etc/sysconfig editor
  2. Within the sysconfig editor, select: System -> File systems -> Mdadm
  3. Set MDADM_MAIL (this can be a comma-separated list)
  4. Set MDADM_SEND_MAIL_ON_START to 'yes'
  5. Click 'Ok' (ignore the error message concerning 'Cannot determine service state') and quit YaST
  6. From the command line do
    systemctl restart mdmonitor.service
    systemctl status mdmonitor.service
    

    The second command should show 'mdmonitor' as 'active' and the command options should include the email address(es) that you entered, as well as the '-t' option (which reflects the "send mail on start' option).

  7. The "restart" command should trigger an email to the designated recipients.