#!/bin/sh while [[ `date +%H%M` < 2331 ]] do NOW=`date` for line in `lsallq` do if [[ ! `lpstat -a$line | grep -c DOWN` = 0 ]] then enable $line #try and reactivate sleep 15 if [[ ! `lpstat -a$line | grep -c DOWN` = 0 ]] then EMSG="Print Queue $line is down. $NOW" #send red alert echo $EMSG | /opt/bin/ito_msg_gen critical LightFax AIX OS else $EMSG="Print Queue $line was down, and was restarted at $NOW." #send yellow alert echo $EMSG | /opt/bin/ito_msg_gen warning LightFax AIX OS fi fi done sleep 900 done exit 0