Скрипт мониторинга mdadm после загрузки

Программа мониторинга mdadm не работает после загрузки. Когда я потом завершаю процесс и снова запускаю mdadm --monitor --scan, все в порядке, и скрипт запускается при сбоях.

Вот мой файл mdadm.conf

# mdadm.conf

# Please refer to mdadm.conf(5) for information about this file.


# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers

# auto-create devices with Debian standard permissions
CREATE owner=root group=disk mode=0660 auto=yes

# automatically tag new arrays as belonging to the local system
HOMEHOST <system>

# instruct the monitoring daemon where to send mail alerts
MAILADDR root
PROGRAM /usr/local/bin/raid-event

# definitions of existing MD arrays
ARRAY /dev/md/0 metadata=1.2 UUID=bdb46a13:5602ce29:d84bf5cd:28e91923 name=ubuntu:0
ARRAY /dev/md/1 metadata=1.2 UUID=e94eb878:bf152bd0:bdb66444:fce7ac6f name=ubuntu:1

и скрипт / usr / local / bin / raid-evnt

#!/bin/bash
event=$1
device=$2
if [ $event == "Fail" ]
then
  notify-send --urgency=critical -i "/usr/share/icons/Humanity/devices/64/drive-harddisk.svg" "Disk "$3" in the Array "$device" has a failure"
  zenity --info --window-icon=/usr/share/icons/Humanity/devices/64/drive-harddisk.svg --text="A failure has been detected on disk "$3" in the Array "$device
else
 if [ $event == "FailSpare" ]
 then
  notify-send --urgency=critical -i "/usr/share/icons/Humanity/devices/64/drive-harddisk.svg" "Spare Disk "$3" in the Array "$device" has a failure"
  zenity --info --window-icon=/usr/share/icons/Humanity/devices/64/drive-harddisk.svg --text="A failure has been detected on spare disk "$3" in the Array "$device
 else
  if [ $event == "DegradedArray" ]
  then
   notify-send --urgency=critical -i "/usr/share/icons/Humanity/devices/64/drive-harddisk.svg" "Disk "$3" in the Array "$device" is degraded"
   zenity --info --window-icon=/usr/share/icons/Humanity/devices/64/drive-harddisk.svg --text="The Array "$device" is degraded because of disk "$3
  else
   if [ $event == "TestMessage" ]
    then
    notify-send --urgency=critical -i "/usr/share/icons/Humanity/devices/64/drive-harddisk.svg" "Raid test message"
    zenity --info --window-icon=/usr/share/icons/Humanity/devices/64/drive-harddisk.svg --text="A Test Message hast benn generated on device" $device
   fi
  fi
 fi
fi

Может кто-нибудь, пожалуйста, помогите мне, Я не нашел ничего полезного.

1
задан 10 November 2017 в 20:39

0 ответов

Другие вопросы по тегам:

Похожие вопросы: