Changes

From SME Server
Jump to navigationJump to search
2,457 bytes added ,  11:09, 22 December 2013
Line 230: Line 230:     
Theses operations are logged, however, no emails will be sent to admin as of the release of packages associated with Bug #6160 or the release of the 8.1 ISO.
 
Theses operations are logged, however, no emails will be sent to admin as of the release of packages associated with Bug #6160 or the release of the 8.1 ISO.
 +
==== Receive periodic check of Raid by mail ====
 +
 +
There are routines in SME Server to check the raid and sent mail to the admin user, when the raid is degraded or when the raid is resynchronizing. But the admin user receive a lot of mails and some time messages can be forgotten.
 +
So the purpose is to have a routine which sent mail to the user of your choice each week.
 +
 +
nano /etc/cron.weekly/raid-status
 +
 +
#!/bin/sh
 +
# cron.weekly/mdadm-status -- weekly status of the RAID
 +
# 2013 Pierre-Alain Bandinelli
 +
# distributed under the terms of the Artistic Licence 2.0
 +
 +
# Get status from the RAID array and send the details by email.
 +
# Email will go to the address specified in the commandline.
 +
set -eu
 +
 +
MDADM=/sbin/mdadm
 +
[ -x $MDADM ] || exit 0 # package may be removed but not purged
 +
 +
DEST="stephane@your-domaine-name.org"
 +
exec $MDADM --detail /dev/md1 /dev/md2 |mail -s "RAID status SME Server" $DEST
 +
 +
save by ctrl+x
 +
chmod +x /etc/cron.weekly/raid-status
 +
 +
each sunday a 4h00 AM you will receive a mail which looks to this :
 +
 +
/dev/md1:
 +
        Version : 0.90
 +
  Creation Time : Sun Jan  6 20:50:41 2013
 +
    Raid Level : raid1
 +
    Array Size : 104320 (101.89 MiB 106.82 MB)
 +
  Used Dev Size : 104320 (101.89 MiB 106.82 MB)
 +
  Raid Devices : 2
 +
  Total Devices : 2
 +
Preferred Minor : 1
 +
    Persistence : Superblock is persistent
 +
 +
    Update Time : Sun Dec 22 04:22:42 2013
 +
          State : clean
 +
Active Devices : 2
 +
Working Devices : 2
 +
Failed Devices : 0
 +
  Spare Devices : 0
 +
 +
          UUID : 28745adb:d9cff1f4:fcb31dd8:ff24cb0c
 +
        Events : 0.208
 +
 +
    Number  Major  Minor  RaidDevice State
 +
      0      8        1        0      active sync  /dev/sda1
 +
      1      8      17        1      active sync  /dev/sdb1
 +
/dev/md2:
 +
        Version : 0.90
 +
  Creation Time : Sun Jan  6 20:50:42 2013
 +
    Raid Level : raid1
 +
    Array Size : 262036096 (249.90 GiB 268.32 GB)
 +
  Used Dev Size : 262036096 (249.90 GiB 268.32 GB)
 +
  Raid Devices : 2
 +
  Total Devices : 2
 +
Preferred Minor : 2
 +
    Persistence : Superblock is persistent
 +
 +
    Update Time : Sun Dec 22 05:30:36 2013
 +
          State : clean
 +
Active Devices : 2
 +
Working Devices : 2
 +
Failed Devices : 0
 +
  Spare Devices : 0
 +
 +
          UUID : c343c79e:91c01009:fcde78b4:bad0b497
 +
        Events : 0.224
 +
 +
    Number  Major  Minor  RaidDevice State
 +
      0      8        2        0      active sync  /dev/sda2
 +
      1      8      18        1      active sync  /dev/sdb2
    
====nospare====
 
====nospare====

Navigation menu