Raid esxi verification

De BlaxWiki
Révision datée du 11 septembre 2013 à 09:48 par Admin (discussion | contributions)
Aller à la navigationAller à la recherche

Ce script sert pour monitorer le raid d'un Esxi >= 5.0. Certaines lignes concernent de la supervision spécifiques, elles peuvent etre ignorées

Pour la mise en place voir [https://{{{SERVERNAME}}}/index.php/Esxi#Raid cette page)

VISION=/opt/agarik/Vision/bin/bb_send_raw
DISPLAY="supervision.so.agarik.eu:1984"
COLOR=green
SERVICE=raid

hosts="esxi1.so.isodev.fr:10.81.13.130 esxi2.az.isodev.fr:10.81.13.132 hv3.randstad.fr:192.168.65.66 hv4.randstad.fr:192.168.65.67  esxi3.isodev.fr:10.253.6.43"

for i in $hosts; do
        name=`echo $i | cut -d ":" -f 1`
        ip=`echo $i | cut -d ":" -f 2`
        /opt/applis/openssh/bin/ssh $ip "cd  /opt/lsi/MegaCLI && ./MegaCli -ldinfo -lall -aall" > /tmp/esx_$$.txt
        state=`grep ^State  /tmp/esx_$$.txt | awk {'print $3'}`
        color=red
        if [ "$state" == "Optimal" ]; then
                color="green"
        fi
        DATA="status+15 $name.$SERVICE $color `/bin/date`
`cat /tmp/esx_$$.txt`"

$VISION $DISPLAY "$DATA"

        rm -f /tmp/esx_$$.txt
done