1838604 Members
4590 Online
110128 Solutions
New Discussion

Printer status

 
SOLVED
Go to solution
Khashru
Valued Contributor

Printer status

Hi,

I need to monitor the printer status connected to hpux server. which command should i use to do that.
9 REPLIES 9
Deoncia Grayson_1
Honored Contributor

Re: Printer status

lpstat -d will give you information:

man lpstat
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Chan 007
Honored Contributor

Re: Printer status

Use

lpstat -p

Chan
Khashru
Valued Contributor

Re: Printer status

I have 30 printer. I use lpstat -t to see them. but it gives a long output. particulary which area should i check.
Deoncia Grayson_1
Honored Contributor

Re: Printer status

when you do a lpstat -t, the first line will state printer is idle and how long its been enable, but at the bottom of this output it will state printer queue for is ready and waiting or busy and a list of print jobs,

best way to sort through this if you're interested in only one print queue is to do:

lpstat -d and it will tell if this printer is available and if there are any jobs waiting to be printed
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Chan 007
Honored Contributor
Solution

Re: Printer status

Hi,

Check for queue name and status.

do a script

keep a copy of all printers in one ascii file. e.g /tmp/t

then
for i in $(cat /tmp/t)
do
echo $i
lpstat -p$i
done

Chan
Khashru
Valued Contributor

Re: Printer status

I am getting the following output.

hpprod:/home/mayub/script :lpstat -pausyd01pr351
printer ausyd01pr351 is idle. enabled since Jan 30 16:12
fence priority : 0

It says it is enable and idle. That means the printer is ok. right?
Chan 007
Honored Contributor

Re: Printer status

Yes, the print sheduler is ready, Idle says that nothing is in its queue.

Chan
Chan 007
Honored Contributor

Re: Printer status

Sorry i was too fast, even check for enable too..,

Chan
Geoff Wild
Honored Contributor

Re: Printer status

Here's a little script I use called lpst

# cat /opt/hpnpl/bin/lpst
#!/bin/sh
#
# check printer status
# Geoff Wild

if [ $# -lt 1 -o \( $# -gt 1 -a $# -lt 4 \) ]
then
echo "Usage:"
echo "lpst \"printer\""
echo "Example:"
echo "lpst W052"
exit 1
fi
echo " "
/usr/sbin/ping $1 -n 2
echo " "
lpstat -p$1 -v$1
echo " "
echo "Output Requests"
echo "-----------------------------------------------------------"
lpstat -o$1
echo " "
lpstat -r
echo " "




Output like so:

# lpst W052

PING pcr12169.pcacorp.net: 64 byte packets
64 bytes from 156.44.163.184: icmp_seq=0. time=6. ms
64 bytes from 156.44.163.184: icmp_seq=1. time=6. ms

----pcr12169.mydomain.net PING Statistics----
2 packets transmitted, 2 packets received, 0% packet loss
round-trip (ms) min/avg/max = 6/6/6

printer W052 is idle. enabled since Jul 19 11:32
fence priority : 0
device for W052: /dev/null

Output Requests
-----------------------------------------------------------
no entries

scheduler is running



Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.