3
#===============================================================
6
# The print queue checker simply looks for an occurance of a
7
# DOWN queue. A note of warning, if you use remote queues in
8
# AIX to redirect print jobs from the AIX queue to an NT print
9
# server that print through DLC rather than IP, it will be very
10
# s - l - o - w. But it will work.
13
# Email: therocker@pawprints.2y.net
14
#===============================================================
16
TMPFILE=/tmp/qtmp.hndl
19
#=======================================================================
21
# This script will also work on AIX 4.2.1 BUT you have to change
22
# the following line. AIX 4.2.1 does not support the -W option
23
# with lpstat. For AIX 4.2.1 just remove the -W option and it should
26
#=======================================================================
28
`rsh $1 -l root lpstat -W | grep -e "DOWN" | tr -s ' ' | cut -d' ' -f1,3 > /tmp/qtmp.hndl 2> /tmp/q_err`
33
#=======================================================
35
# If you've seen the other AIX scripts I wrote you may
36
# notice that I use this bit of code a lot. Well it
37
# works and appears to be all purpose.
39
#=======================================================
41
LINES=`wc -l /tmp/qtmp.hndl | cut -c8`
42
LINESCTL=`wc -l /tmp/qtmp.hndl | cut -c8`
44
echo "Print Queue DOWN --> \c"
46
while [ $LINESCTL != 0 ]
49
cat $TMPFILE | tail -$LINESCTL > $TMPTOO
50
cat $TMPTOO > $TMPFILE
51
LINESCTL=$(( $LINESCTL -1 ))
52
LINES=$(( $LINES -1 ))
53
DATA=`head -1 /tmp/qtmp.hndl`
66
echo "Print Queues Running... OK"