Surveillance Raid HP

De Linux Server Wiki
Aller à la navigation Aller à la recherche
#! /bin/bash

array_result=`ssacli controller all show status | grep -v "Smart Array P222 in Slot" | grep -v OK`
disk_result=`ssacli controller slot=1 physicaldrive all show | grep -v "Smart Array P222 in Slot" | grep -v "Array" | grep -v OK`

if [ ! "$array_result" == "" ] || [ ! "$disk_result" == "" ]; then
        echo "raid error"
        ssacli controller all show status > /tmp/raiderror
        ssacli controller slot=1 physicaldrive all show >> /tmp/raiderror
        cat /tmp/raiderror | mail -s "$HOSTNAME raid array error" root
        rm -rf /tmp/raiderror
fi