Setting up e-mail notifications for Linux Software RAID: Difference between revisions

From csml-wiki.northwestern.edu
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
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.
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.


Note: on OpenSuSE Leap 42.1, you need to copy /etc/rc.d/mdadmd from OpenSuSE 13.1 before applying the steps below.
Note 1: instructions are specific to OpenSuSE.


* openSuSE 13.1
Note 2: on OpenSuSE Leap 42.1, you need to copy /etc/rc.d/mdadmd from OpenSuSE 13.1 before applying the steps below.


<ol>
<ol>
Line 11: Line 11:
<li>Within the sysconfig editor, select: System -> File systems -> Mdadm</li>
<li>Within the sysconfig editor, select: System -> File systems -> Mdadm</li>


<li>Set MDADM_MAIL (for OpenSuSE 13.1 this can be a comma-separated list, for OpenSuSE 11.1 it must be a single email address)</li>
<li>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)</li>


<li>Set MDADM_SEND_MAIL_ON_START to 'yes'</li>
<li>Set MDADM_SEND_MAIL_ON_START to 'yes'</li>


<li>Click 'Ok' (ignore error message on OpenSuSE Leap 42.1) and quit YaST</li>
<li>Click 'Ok' and quit YaST</li>


<li>From the command line do
<li>From the command line do
Line 26: Line 26:


</ol>
</ol>

* openSuSE Leap 42.1

<li>Go to YaST -> System -> /etc/sysconfig editor</li>

<li>Within the sysconfig editor, select: System -> File systems -> Mdadm</li>

<li>Set MDADM_MAIL (this can be a comma-separated list)</li>

<li>Set MDADM_SEND_MAIL_ON_START to 'yes'</li>

<li>Click 'Ok' (ignore the error message concerning 'missing service') and quit YaST</li>

<li>From the command line do
<pre>
systemctl restart mdmonitor.service
systemctl status mdmonitor.service
</pre>
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). Moreover, the "restart" command should have triggered an email to the designated recipients.

Revision as of 19:08, 27 November 2017

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.

Note: on OpenSuSE Leap 42.1, you need to copy /etc/rc.d/mdadmd from OpenSuSE 13.1 before applying the steps below.

  • 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
  • Go to YaST -> System -> /etc/sysconfig editor
  • Within the sysconfig editor, select: System -> File systems -> Mdadm
  • Set MDADM_MAIL (this can be a comma-separated list)
  • Set MDADM_SEND_MAIL_ON_START to 'yes'
  • Click 'Ok' (ignore the error message concerning 'missing service') and quit YaST
  • 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). Moreover, the "restart" command should have triggered an email to the designated recipients.