]>
git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - modules/profile/files/monitoring/check_md_raid
9c79a7adb59120ff22aa13afd7ab5781bbaca36b
3 # Created by Sebastian Grewe, Jammicron Technology
6 # Get count of raid arrays
7 RAID_DEVICES
=`grep ^md -c /proc/mdstat`
9 # Get count of degraded arrays
10 RAID_STATUS
=`grep "\[.*_.*\]" /proc/mdstat -c`
12 # Is an array currently recovering, get percentage of recovery
13 RAID_RECOVER
=`grep recovery /proc/mdstat | awk '{print $4}'`
16 # RAID recovers --> Warning
17 if [[ $RAID_RECOVER ]]; then
18 STATUS
="WARNING - Checked $RAID_DEVICES arrays, recovering : $RAID_RECOVER"
21 elif [[ $RAID_STATUS == "0" ]]; then
22 STATUS
="OK - Checked $RAID_DEVICES arrays."
24 # All else critical, better save than sorry
26 STATUS
="CRITICAL - Checked $RAID_DEVICES arrays, $RAID_STATUS have FAILED"