« Surveillance Raid HP » : différence entre les versions

De Linux Server Wiki
Aller à la navigation Aller à la recherche
(Page créée avec « <pre> #! /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... »)
 
Aucun résumé des modifications
 
Ligne 1 : Ligne 1 :
[[Category:raid]]
<pre>
<pre>
#! /bin/bash
#! /bin/bash

Dernière version du 16 décembre 2018 à 01:27

#! /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