PROJET AUTOBLOG


Planet-Libre

source: Planet-Libre

⇐ retour index

Pierre-Alain Bandinelli : L'état d'un RAID logiciel Linux résumé par courriel

lundi 23 septembre 2013 à 20:01

Voilà un petit script très simple pour recevoir automatiquement par courriel l'état d'un RAID logiciel sous Linux :

#!/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="administrateur@cestmoi.fr"
exec $MDADM --detail /dev/md0 /dev/md1 /dev/md2 |mail -s "RAID status" $DEST

On peut placer ce script dans cron.weekly pour recevoir ces informations manière hebdomadaire par exemple.

Longue vie à votre RAID !

Gravatar de Pierre-Alain Bandinelli
Original post of Pierre-Alain Bandinelli.Votez pour ce billet sur Planet Libre.