IBM Support

Understanding Print Queue Status

Question & Answer


Question

Understanding Print Queue Status

Answer


This document discusses the methods of obtaining information from AIX queues and the information returned when getting queue status information. Special topics include how to avoid the wait when remote queues return delayed status and how to display file names with the status commands.

This document covers all levels of AIX.

AIX printer status commands
AIX printer status field format
AIX printer status conditions
Remote queue status
Viewing only local queue status
Viewing the long filenames in the status
Viewing the temporary filenames in the status


AIX printer status commands

The AIX status commands are shown below. For details see the man pages for each command.

  • enq [ -q | -A ] [ -L | -W ] [ -e ] [ -# JobNumber ] [ -u Name ] [ -w Seconds ] [ -s]
  • qchk [ -A ] [ -L | -W ] [ -P Printer ] [ -# JobNumber ] [ -q ] [ -u UserName ] [ -w Delay ]
  • lpstat [ -aList ] [ -cList ] [ -d ] [ -oList ] [ -pList ] [ -r ] [ -s ] [ -t ] [ -uList ] [ -vList ] [ -W ]
  • lpq [ + [ Number ] ] [ -l | -W ] [ -P Printer ] [ JobNumber ] [ UserName ]

AIX printer status field format

A typical, short (default) status will look like:

Queue   Dev   Status    Job Files              User         PP %   Blks  Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
asc     lp0   RUNNING   165 STDIN.20178        jwtesch       5 19    21   1   1
              QUEUED    167 STDIN.22612        root                  42   1   1
              QUEUED    169 STDIN.22644        root                  21   2   3
              QUEUED    170 /etc/motd          root@aix4p             1   1   4
Queue
Print Queue name.
Dev
Print Queue Device Name. If the Queue has multiple devices, they can be addressed individually as queue:device. If this is a local queue, this will usually have the name of the special device file in the /dev directory, but there is really no linkage between the queue device and the /dev device unless specified in the FILE= parameter of the queue device. Wise practice will limit queue device names to 5 characters.
Status
This is the condition of the queue.
See AIX printer status conditions.
Job
This is the Job number assigned by enq at AIX 4, or by the qdaemon at AIX 3. This number is determined by the next number in /var/spool/ldp/pio/stat/numfile. This is the job that you can cancel or set the priority for.
Files
These are the file names of the files printing. STDIN indicates the data has been piped to the print command.
User
This is the name of the user who submitted the job. If the user is on a remote system, it will also try to identify the client name in this field by using space available.
PP
Pages Printed.
This is not entirely accurate. How it is used depends on the pipeline of backend programs. For piobe on local queues, this number will be more of an indicator of pages counted during the formatting process for ASCII files only. This value has no meaning for PostScript or Passthrough queues.
Note: This will not accurately reflect the data that is in the output tray of the printer.
%
Percent of Job Printed. In most cases this will be an indication of the percent of the bytes in the file that have been sent to the Printer or Print Server. This may vary based on the backend and shouldn't be used for performance monitoring or the like.
Blks
Number of thousand-byte blocks in the file. This factor is not determined by processing, but by a system call.
Cp
Number of Copies of the file to be printed. The number specified by the enq or qprt -N flag, the lpr -# flag, or the lp -n flag.
Rnk
Rank or order of the print job on this queue. Number 1 will print first, 2 next, and so on.

AIX printer status conditions

The status conditions vary depending on the backend programs, but they are fairly standard for local queues. They are defined in:

  • /usr/include/IN/backend.h

The Defined status conditions are:

READY
Queue is up. This queue has no jobs waiting to be printed and is ready to accept new jobs if qdaemon is running.
RUNNING
Queue is running a job; other jobs can be queued and will be printed when this job is done.
WAITING or DEV_WAIT
Queue could not open and is waiting on a device. The device may be out of paper, offline, jammed, or have wiring problems. NEVER add, remove or change any queue when a queue on the same system is in a DEV_WAIT state without first correcting the problem.
OFF or DOWN
Queue is down. The queue has been disabled with enq -D, or disable, or qadm -D. The queue will accept jobs, but they will not be run until the queue is reenabled with enq -U, enable, or qadm -U.
INIT or INITIALIZE
Driver is initializing. This is most often seen with PSF/6000 queues while the subsystem is coming up.
SENDING
Data is being sent to a remote host either with rembak or a socket program such as piohpnpf (JetDirect) or the MarkNet software.
GETHOST
Queue is in the process of determining the foreign server.
CONNECT
Backend is in the process of establishing connections with a remote server.
BUSY
The device that is to be used by the backend is busy printing another job for another queue, or is in a locked state.

Remote queue status

When obtaining the status of a remote queue, the status of both the local queue and the remote queue will be shown. This will usually give a status such as:

Queue   Dev   Status    Job Files              User         PP %   Blks  Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
gena    @tesc READY     <---- client queue gena, queue device @tesch
gena    genas DOWN      <---- server queue genasc, queue device lpx
              QUEUED    167 STDIN.22612        root                  42   1   1
              QUEUED    170 /etc/motd          root@aix4p             1   1   4
The exact format of the remote status will depend on the type of LPD running on the server as well as the stat filter setup in the client queue.

In the preceding case, The local (client) queue is empty and shows that the data has already been passed to the remote queue, which is down. The queue on the remote (server) system also has a job #167 that was sent locally on the server.

The Queue name for both lines of the status will show the client queue name as the name, but the Device will show the client device (usually the server name) for the local status line and the server queue name for the device name of the remote queue status line.
Note: Only five characters of the device name will display.

Viewing remote queue status with two queue devices

If the server has two queue devices for the queue, then you will see three lines in the status as follows:

#lpstat -vteschasc
Queue   Dev   Status    Job Files              User         PP %   Blks  Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
teschas @tesc READY     <----  client queue teschasc:@tesch
teschas asc   READY     <----  server queue asc:lp0
asc     lpxt  READY     <----  server queue asc:lpxt
Note that the third line (the second queue device on the server queue) has the queue name of the server queue.

Viewing only local queue status

One frequent problem encountered with remote queue status is the long wait for queues to timeout if the remote server is down. Sometimes it is only important to check the status of the queues on the server. This can be done as follows:

  • AIX 3.2: enq -sA
  • AIX 4: enq -isA
  • AIX 5: enq -isA

Viewing the long queue names in the status

By default, only the first seven characters of the queue name is displayed in the status. This can create some confusion when longer queue names are used. Here is an example of three queues that have the same first seven characters. One of the queues is a remote queue while the other two are local. The normal lpstat looks like this:
# lpstat
Queue   Dev   Status    Job Files              User         PP %   Blks  Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
rm2004_ @aix4 READY    
rm2004_ asc   READY     
rm2004_ lp0   READY    
rm2004_ lp0   READY

By using the enq -W flag, these names can readily be identified as shown here:

# enq -A -W
Queue                Dev            Status    Job    Files              User
-------------------- -------------- --------- ------ ------------------ ----
rm2004_laser01       @aix4prt       READY    
rm2004_laser01       asc            READY     
rm2004_pcl           lp0            READY 
rm2004_ps            lp0            READY    

Viewing the temporary filenames in the status

To view temporary filenames in the status, use the lpstat -t flag. By default, only the original file name is displayed. The enq -L flag will also display this information. The first half of the line looks like this:
# lpstat -t -vasc 
Queue   Dev   Status    Job     Name           From           To 
------- ----- --------- --------- --- ---      ----- ---        ---- --
asc     lp0   DEV_WAIT  785     STDIN.113993   jwtesch@alcatr jwtesch@alcatr 
  
              QUEUED    786     STDIN.30663    jwtesch@alcatr jwtesch@alcatr 
The second half of the status lines contains the temporary file name as shown here:
   Submitted        Rnk Pri       Blks  Cp    PP %
01/19/99 17:02:25    1  15          4   1          /var/spool/lpd/dfA184alcatraz
01/19/99 17:02:48    2  15         36   1          /home/violet/scream.text
NOTE: This also shows the date and time that the job was queued. In this example both files have names beginning with STDIN, which means that they were either piped to the print command, or received by lpd from a remote client. In this case, the first file must have come from a remote client because it is stored in /var/spool/lpd. The second file must have been piped to a print command, maybe using cat /home/violet/scream.text | enq.

[{"Product":{"code":"SWG10","label":"AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Attached devices","Platform":[{"code":"PF002","label":"AIX"}],"Version":"5.3;6.1;7.1","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Historical Number

isg1pTechnote0713

Document Information

Modified date:
06 December 2019

UID

isg3T1000408