Nothing incredibly clever, but it works a treat - we have 6 drives, so if any of the 6 are in a state other than normal (TLD) then send a mail. I've got this running in cron every 10mins
#! /bin/ksh
#
if [ `/usr/openv/volmgr/bin/vmoprcmd|grep hcart|grep " TLD"|grep -c " TLD"` -lt 6 ] ; then /usr/openv/volmgr/bin/vmoprcmd|grep -v PEND|grep -v "<"|grep -v STATUS|grep -v Drive|grep -v " TLD" |/usr/ucb/mail -s "There are DOWN or unavailable
NetBackup tape drives @`date +%d/%m-%H:%M`" emailaddy@somewhere.co.uk
else
echo
fi
p.s. i use a very similar script to monitor for pending restore requests, ie when a required tape is not in the robot, it will sit waiting for eons, so every 10mins i check for pending requests & then send an email
Oh and just thought of another - have a similiar script that checks for busy drives, ie if all 6 are in use it sends a mail; helps to idenfity bottlenecks, though this doesn't shout much due to lots of multiplexing
Rich