Raid Error status inforamtion

Hi frnds,

I want excute the command through shell script.

command is #metastat
once u excute this cmd we will get some information on raid configuration status.
Once it is working properly we will get status 'okey' otherwise will get status 'error'.

i want to script for
once we get status 'error', it should send to my mail id.
Please..itz very urgent for me.

Adv. Thanks
Arjunreddy