Is that zone running?

On a number of occasions, I have had zones just disappear for no good reason.
Until I get to the bottom of that, here is a small script that I have cron’ed that
notifies me that there is trouble.

#!/bin/ksh
############################################
# zone-check.sh, v.1.0, Nov 10,2008
# Written by Nuno Paixao
#############################################
NOTIFY_LIST="someone@somewhere.com"
ZONE_LIST=`/usr/sbin/zoneadm list -cp | cut -d":" -f2 | grep -v global`
for ZONE in ${ZONE_LIST}
do
  STATUS=`/usr/sbin/zoneadm -z ${ZONE} list -p 2> /dev/null | cut -d":" -f3'`
  if [ "$STATUS" != "running" ]; then
    for EMAIL in ${NOTIFY_LIST}
    do
      mailx -s "ERROR: Zone ${ZONE} is not running on `uname -n`." 
             $EMAIL < /dev/null
    done
  fi
done
exit 0