Simple shell script that reads /proc/mdstat and creates some status according to that files content.
Unlike other scripts found here this script does not need any root access to mdadm.
Just start it, the script doesn't need any arguments.
chmod +x check_md_raid.sh ./check_md_raid.sh
Update : Added resync support thanks to decibel83.