Re: Solaris 2.6 "lpstat -p" timeout issue

From: Greg Andrews (gerg_at_panix.com)
Date: 03/18/04


Date: Thu, 18 Mar 2004 21:37:29 +0000 (UTC)

mikes@hartwellcorp.com (Michael St. Laurent) writes:
>
>Is there an alternate to using the "lpstat -p" command? I need to
>list each printer and determine whether or not it is currently
>printing something.
>

"lpstat -p" works well for local and network printer queues.
It does not work well for remote printer queues, particularly
when the print server does not respond quickly.

I believe the delays you're experiencing are due to the latter
problem. You have printers defined as remote printers on this
Solaris computer, and when lpstat tries to contact the print
server through the network to learn the queue status, the print
server responds slowly (or the DNS lookups to find the print
server's IP address are slow).

If this Solaris machine delivers the print jobs directly to the
printers (not by giving the jobs to another computer), then you
are probably using the wrong configuration. Use the network
printer configuration for printers attached to the network, and
the local printer configuration for printers attached to the
serial or parallel port of this Solaris machine. Then lpstat -p
asks the local lpsched daemon for the queue info and receives the
answer quickly.

The other potential problem is the thing I hinted at above: DNS.
Are DNS lookups slow for some of the print servers some of the
time? This can be true for print servers at sites different
from your own. Your DNS servers try to find the DNS servers for
the other site, but don't get a fast response.

Another question is: Why does your program care how many jobs
are printing on the printer? Shouldn't managing printer queues
be performed by the print server software rather than your
application? Solaris has printer classes specifically designed
to send print jobs to idle printers when others are busy (and
the idle printers are equally capable of printing the job as the
busy ones). Perhaps you can avoid the whole problem by re-thinking
the need to know how many jobs are printing in each queue.

  -Greg

-- 
Do NOT reply via e-mail.
Reply in the newsgroup.


Relevant Pages

  • Re: Cannot remove files sent to a printer
    ... I am actually printing to a print server attached to the printer. ... I have checked with the other users who have no problems and the connection ... can see the printer on the network and everything else is working properly. ...
    (microsoft.public.windowsxp.print_fax)
  • Re: Printer sharring issues I think...?
    ... me to replace the switch at this time. ... own NIC connected to the network or are connected to a computer via USB. ... If the SBS can't see the printers, the jobs will just stick ... DNS bascially everything newtworking is also the print server. ...
    (microsoft.public.windows.server.sbs)
  • Re: Jobs stop printing on Server
    ... Tony Edgecombe ... > We have multiple printers shared from out print server, ... > Every week we go through and clear out all the old jobs. ... > The thing is, if there's a lot of printing done, ...
    (microsoft.public.win2000.printing)
  • Re: Printing problems with FC6
    ... computers can print to the attached printer. ... "allow printing from network". ... Is there a proper "fedora-way" to tell cups to allow for network ... LAN will be able to print to the print server. ...
    (Fedora)
  • Re: prompt admin to allow or deny print job to continue printing
    ... printer, then resume the jobs that have been paid for, then pause the ... Windows Printing Team ... The print server is Windows XP Professional and there are two printers ...
    (microsoft.public.windowsxp.print_fax)