Hi all!

I'm using a bash script to extend the notification of events on mdadm:

# cat /etc/mdadm/mdadm.conf:
(...)
PROGRAM /usr/local/scripts/monitorRaidv2.sh


But it seems that mdadm does not trigger the RebuildXX events.

This is the portion of the script:

-----------------------------------------------------------------------
#
# Functions
#

# Compases a rebuild message
#
# Param 1: Percent complete
# Param 2: Device affected

rebuild_message() {
    $APP_CAT >$MESSAGE <<EOF
This is an automatically generated e-mail from the RAID administration
software running on `hostname`,

The RAID array $2 has completed $1% of its rebuild.
EOF
}

#
# Main
#

case $RAID_EVENT in

(...)

Rebuild20)
     $APP_ECHO -e "[`$APP_DATE +%d/%b/%Y:%T`] | $RAID_EVENT" >> 
$LOG_DIR/$LOG_FILE
     rebuild_message 20 $2
     ;;

Rebuild40)
     $APP_ECHO -e "[`$APP_DATE +%d/%b/%Y:%T`] | $RAID_EVENT" >> 
$LOG_DIR/$LOG_FILE
     rebuild_message 40 $2
     ;;

Rebuild60)
     $APP_ECHO -e "[`$APP_DATE +%d/%b/%Y:%T`] | $RAID_EVENT" >> 
$LOG_DIR/$LOG_FILE
     rebuild_message 60 $2
     ;;

Rebuild80)
     $APP_ECHO -e "[`$APP_DATE +%d/%b/%Y:%T`] | $RAID_EVENT" >> 
$LOG_DIR/$LOG_FILE
     rebuild_message 80 $2
     ;;

(...)

esac

for MAIL in $ADMIN_MAIL; do
  $APP_CAT $MESSAGE |mail -s "[$HOSTNAME] RAID $1 Event" $MAIL
done

-----------------------------------------------------------------------

Nor do I see the event to be logged in the syslog or alternative log
showing in the previous code. After simulating a disk failure, these
events are logged:

[16/jun/2014:18:54:14] | Fail
[16/jun/2014:19:38:50] | RebuildStarted
[16/jun/2014:19:39:11] | RebuildFinished
[16/jun/2014:19:39:11] | SpareActive

I am using Debian GNU/Linux Wheezy with mdadm 3.2.5-5 from Debian 
repositories.

I'm missing some additional configuration for the RebuildXX 
event is triggered?


Thanks in advance for your replies.

Best regards,
Daniel


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/trinity-aaf8dc71-7b24-476e-b411-bcfc85c68f00-1403005101012@3capp-gmx-bs14

Reply via email to