Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to show Down print queues???

Status
Not open for further replies.

DTicky

IS-IT--Management
May 7, 2002
6
0
0
US
Help... I need to write a script that only show print queues that are down. I have a function that show all the print queues:

function queue_status {
/usr/bin/enq -e "$@" | /usr/bin/awk '
$1 ~ /:$/ { print $0; next}
{ if (substr($0,1,7) != " ") print substr($0,1,24); }'} ; queue_status '-As'

Unfortunately this prints all the queues and doesn't stop at the end of the page. Thanks, Donna
 
> /usr/bin/enq
Paste the output of this command - showing both up and down queues
 
If all you want is the down queues do this

lpstat -W | grep -i DOWN

you could redirect this to a file or your screen.
 
Salem thanks for your response but I don't know how to do that. I don't really know scripts.

lbauen thanks for your response also. Unfortunately since many of the the remote hosts are not logged in this takes a long time. The script I have responds quicly but shows nore that I want.

Please help.
Thanks again
 
There's nothing to stop you typing in fragments of the script you have at the command line to see what each part does.

So you type in
Code:
    /usr/bin/enq -e -As
and you paste whatever comes back in this forum.

Then perhaps we can start to make sense of what the '| awk...' bit it up to.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top