This is an old revision of the document!
#!/bin/ksh #---------------------------------------------------------------------- # Check drives, bring drive up if down, email # If drives are up, do not create a report, runs from cron #---------------------------------------------------------------------- # Add interested parties below: alert_mail=mail@mydomain.co.za /usr/openv/volmgr/bin/vmoprcmd -d ds | grep "DOWN" >/dev/null if [ $? -ne 1 ];then rm /tmp/drivelog /bin/date >> /tmp/drivelog echo "" >> /tmp/drivelog for i in `/usr/openv/volmgr/bin/vmoprcmd -d ds | tail -n +5 | grep "DOWN"|awk '{print $1}'` do echo -e "Drive $i is in DOWN status, bringing drive UP\n" >> /tmp/drivelog /usr/openv/volmgr/bin/vmoprcmd -up $i done /usr/openv/volmgr/bin/vmoprcmd -d ds >> /tmp/drivelog cat /tmp/drivelog | /bin/mail -s "Drive(s) outages on `hostname`" \ $alert_mail fi