I think I found how to do it, using an Expect script. I haven't tried it yet 'cause I don't have the pfsense machine close, but I will as soon as I can boot it up.
Here is the script:
http://bash.cyberciti.biz/security/sshlogin.exp.php
This script is executed from a remote host, on which expect is installed. I'm just beginning with expect, so I hard-coded all my values in the script. I know this exposes the firewall root password in a file, but I think I can live with that until I find a better way to be alerted when a drive fails.
#! /bin/bash
RETVAL=0
/home/user/expect_amrstat > /home/user/expect_degraded
grep Degraded /home/user/expect_degraded >dev/null
RETVAL=$?
if [ "$RETVAL" = 0 ]; then
echo "Array degraded on firewall" |mail -s "Array Degraded" me@mydomain.com
fi
The script /home/user/expect_amrstat simply runs amrstat on the firewall and outputs the result.