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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PLS HELP....AIX (Frequent Remote Printer Down)

Status
Not open for further replies.

sraj142

Technical User
Oct 25, 2006
49
IN
Hi...Guys
Please help me. I have problem with some remote printer installed(LPT1) in IBM AIX 5L. I am using LPD Demon to take print from AIX. But oftenly the print queue is showing down & I have to enable the printer again & again. I am using 64KBP leased line which almost giving 99% uptime.
Is there anybody to help me out...how to solve the trouble. Please let me know.
 
Create a script that checks the queue and re-enables it if it's down something like (Not tested) and run from crontab.

enq -qs -A |
while read printer dev status
do
if [ "$status" = "DWN" ]
then
enable $printer
fi
done

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Seems to work for some printers Mike, but I don't know whether the enable would work if the printer name is longer than the 'Queue' field allows in the output of enq -qs -A.

Alan Bennett said:
I don't mind people who aren't what they seem. I just wish they'd make their mind up.
 
If it's only the one printer, adapt Mike's script like:

lpstat -pprintername |
while read printer dev status
do
if [ "$status" = "DOWN" ]
then
enable printername
fi
done

Alan Bennett said:
I don't mind people who aren't what they seem. I just wish they'd make their mind up.
 
If you wanted to check all printers and want to avoid the name length issue, you could do something like:

Code:
lsallq | while read printer
do
  lpstat -p${printer} | while read pname dev status
  do
      if [ "${status}" = "DOWN" ] ; then
         enable ${pname}
      fi
  done
done

Regards,
Chuck
 
Hi Guys...thank you all for the reply, But what about the jobs in the queue which are already printed but, not cleared from queue. After enabling printer thease jobs will also be printed out, which I need to overcome.

Pls help.

Regards,
sraj142

 
See thread52-1182246 for a few different ways to do this.

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top