AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  lpstat query

    Posted Wed April 22, 2009 11:04 PM

    Originally posted by: SystemAdmin


    Hi there, I got a problem with lpstat command in AIX and hope that anyone can help.

    I need to retrieve detail pending print entries' information by issuing lpstat, the information should contain the printing entry's insertion time, hence I use 'lpstat -t', but I found that the print queue name is truncated down to 7 characters in the output.

    PRTQUE0 hp@RT DOWN
    QUEUED 464 /tmp/MARP usr001 grp001
    04/17/09 11:21:32 1 15 8 1
    /tmp/MARP0014.230717957_15.ps
    The print queue name is actually '*PRTQUE01*' but in the output it got truncated.

    Does anyone know how I can get full print queue name in such case?
    #AIX-Forum


  • 2.  Re: lpstat query

    Posted Thu April 23, 2009 12:22 AM

    Originally posted by: SystemAdmin


    Have you tried "lpstat -W" to get a wide listing (in AIX)?
    #AIX-Forum


  • 3.  Re: lpstat query

    Posted Thu April 23, 2009 02:18 AM

    Originally posted by: SystemAdmin


    thanks Spook, I've tried 'lpstat -W' but it can not provide me the time of pending peint entries. And from AIX manual, -W and -t could not take effect when they are used together. The first one in their combination take effect.
    #AIX-Forum


  • 4.  Re: lpstat query

    Posted Wed April 29, 2009 08:53 PM

    Originally posted by: SystemAdmin


    You are right. Unfortunately, this means that you will have to roll your own using a shell script. You could run a "lpstat -rW", which you feed into a do loop, and then run a "lpstat -t -p queue" for each line of output. You will then have to extract the data that you want from the "lpstat -rW" and the "lpstat -t" commands and combine into a decent report.

    Another option would be to roll your own using "lsallq -c" instead of the "lpstat -rW". We found this was faster; especially when users turn off printers and lpstat/enq takes several minutes to generate a listing.

    It takes even more work, but our final solution used the expect language to generate a listing. This way we were able to run all queue queries in parallel, rather than sequentially, and with a 5 second timeout, so that the script always finishes quickly.
    #AIX-Forum