Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37504280
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
# mpt-status monitoring wrapper
# based on http://prefetch.net/reference/mpt-status.spec
# NB: tested against a single SAS1068 HBA only
export PATH=/bin:/usr/bin:/sbin:/usr/sbin

MPT_ID=
MPT_ARGS="-s"
MPT_LOGLEVEL="kern.err"

[ -s /etc/sysconfig/mpt-status ] && source /etc/sysconfig/mpt-status

[ -n "$MAILTO" ] || exit 0
[ -n "$MPT_ID" ] && MPT_ARGS="$MPT_ARGS -i $MPT_ID"

# The return code from mpt-status is a bit mask, and can be interepreted
# according to the following table (current as of 1.2.0):
# Bit Value Meaning
# -----------------------------------------------------------------
# 0 1 Abnormal condition / unknown error
# 1 2 A logical volume has failed
# 2 4 A logical volume is degraded
# 3 8 A logical volume is resyncing
# 4 16 At least one physical disk failed
# 5 32 At least one physical disk is in warning condition

OUT="`mpt-status $MPT_ARGS`" || {
echo -e "check mpt-status $MPT_ARGS on $HOSTNAME\n\n$OUT" | mail -s "[$HOSTNAME] mpt-status: disk failure" "$MAILTO"
logger -p "$MPT_LOGLEVEL" "STORAGE ERROR: A failure was detected with the LSI Logic RAID controller or one of the disk drives"
logger -p "$MPT_LOGLEVEL" "STORAGE ERROR: Run mpt-status to view the status of the storage subsystem"
}
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin