:
Check any problem on a Software RAID.
To use it, save it with name “check_raid” on plugins folder on pandora agent, and add the following line on the configuration file:
module_plugin check_raid
Author: Manuel Angel Fernandez
His blog: http://rastreador.com.es/
Module data
#!/bin/bash for i in $(mdadm --detail --scan | cut -d" " -f2) do RAIDSTATUS=$(mdadm --query --detail $i | grep "State :" | tr -d " ")
CHECK=$(echo $RAIDSTATUS | egrep -c "State:clean,checking|State:active|State:clean")
if [ $CHECK -eq 0 ] then OUT="1" # DESC="Array $i status" DESC=$RAIDSTATUS else OUT="0" DESC="Check OK of Raid $i errors with mdadm" fi echo "<module>"; echo "<name>< ![CDATA[Check_raid $i]]></name>"; echo "<type>< ![CDATA[generic_data]]></type>"; echo "<data>< ![CDATA[$OUT]]></data>"; echo "<description>< ![CDATA[$DESC]]></description>"; echo "<min_critical>1</min_critical>"; echo "</module>"; done
(Visited 474 times, 1 visits today)