Репозиторий Sisyphus
Последнее обновление: 22 сентября 2019 | Пакетов: 17472 | Посещений: 15143748
en ru br
Репозитории ALT
S:1.2.0-alt2.qa1
5.1: 1.2.0-alt2
4.1: 1.2.0-alt2
4.0: 1.2.0-alt2
www.altlinux.org/Changes

Группа :: Мониторинг
Пакет: mpt-status

 Главная   Изменения   Спек   Патчи   Исходники   Загрузить   Gear   Bugs and FR  Repocop 

#!/bin/sh
# a script to setup MPT status monitoring
# 2008, Michael Shigorin (mike altlinux org)

# NB: tested against a single SAS1068 HBA only

warning() { echo $0: $* >&2; }
error() { warning $*; exit 1; }

[ -d /proc/scsi/mptspi/ -o -d /proc/scsi/mptsas/ ] || \
error "you don't seem to have MPT-based RAID controller available"

echo "Setting up MPT status monitoring..."

lsmod | grep -q ^mptctl || modprobe mptctl
[ -f /etc/modules ] && {
grep -q ^mptctl /etc/modules || echo mptctl >> /etc/modules
}

DEVICE_ID="`mpt-status -p | sed -n 's/^Found SCSI id=\([0-9]\+\).*$/\1/p'`" || \
error "mpt-status -p failed, please check by hand"

CONFIG="/etc/sysconfig/mpt-status"
MPT_ID=
MPT_ARGS=
MAILTO=

touch "$CONFIG"
. "$CONFIG"

[ -n "$DEVICE_ID" ] || error "No device id detected"
[ -n "$MPT_ID" ] && {
[ "$MPT_ID" = "$DEVICE_ID" ] || {
warning "MPT_ID in /etc/sysconfig/mpt-status differs from mpt-status report;"
warning "not touching anything"
} # otherwise it's already there and the same
} || {
echo "Writing device id: $DEVICE_ID to $CONFIG"
echo "MPT_ID=$DEVICE_ID" >> "$CONFIG"
}

# enable monitoring cronjob unless specifically disabled
[ -n "$MAILTO" ] || echo 'MAILTO="root@localhost"' >> "$CONFIG"
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin