Advanced functions of LP Plus are addressed in part 4 . These features include:
- network management.
- event processing.
- WinPrint client messaging.
- report segmenting and distribution.
- printer resource accounting.
- submitting print jobs through directory lookup.
LP Plus can both print over TCP/IP using the LPD/LPR protocol and receive print jobs from other LPD/LPR compatible hosts. This means it can print to and receive from any system or device that supports LPD/LPR protocol (most TCP/IP software are hardware products support LPD/LPR printing). LP Plus seamlessly integrates with any network environment either with LP Plus acting as a print server in a large UNIX network, or with LP Plus installed on multiple machines for centralized printer and print queue management.
With LP Plus on multiple UNIX hosts, commands and status information can be sent over TCP/IP to and from the LP Plus hosts. This allows one host to transparently manage all of the others. With the exception of viewing reports and the log file, all LP Plus commands and all status information can be controlled from one host. Control over multiple LP Plus hosts can also be accomplished using WinPrint™ from a Windows 3.1, 95, or NT client.
There are three network commands associated with LP Plus. Each performs a separate task. The commands are:
dcclpdser - The LPD server is used to accept print jobs from other applications that support the LPD/LPR protocol over a TCP/IP network. It must be active in order to receive print jobs from other remote hosts (LP Plus or other). The LPD server is not required for LP Plus to send print requests to other systems or applications supporting the LPD/LPR protocol. The LPD server listens to socket 515 by default (the "printer" service in the /etc/services file) for incoming print jobs. Because only one application can listen to a socket at a time, if the UNIX lp line print daemon is already listening to socket 515 ("printer tcp/515" in the /etc/services file), the LP Plus dcclpdser will fail.
The LPD server can be started and stopped from the LP Plus Administration "Services" menu (refer to Daemon Administration in Part 3 for information on starting and stopping the LP Plus LPD server). It can also be started from the command line as follows:
dcclpdser [host_name] [service_name] - The defaults are the "node name" for the [host_name] and "printer" for [service_name]. There must be an entry in the /etc/hosts file for [host_name] and /etc/services file for [service_name].
dccbkst - The LP Plus network status (dccbkst) server is used to accept and send LP Plus print queue and printer status and commands between LP Plus systems over a TCP/IP network. It must be running on each LP Plus host that will be managed from either another LP Plus host on the network or from a WinPrint client. The network status server is not required for LP Plus to send print requests to other systems or applications supporting the LPD/LPR protocol. The server listens to socket 53971 (the "dccbkst 53971/tcp" service in the /etc/services file) by default for incoming LP Plus commands. The network status server is also used to accept network commands from WinPrint clients.
The network status server can be started and stopped from the LP Plus Administration "Services" menu (refer to Daemon Administration in Part 3 for information on starting and stopping the network status server). It can also be started from the command line as follows:
dccbkst [host_name] - The defaults are the "node name" for the [host_name]. There must be an entry in the /etc/hosts file for [host_name] and /etc/services file for "dccbkst 53971/tcp".
dccnetstat - The LPD/LPR network status program is used to get print queue and printer status information from non LP Plus hosts. The remote system must support the LPD/LPR protocol. This command is rarely used and is only intended to get printer and queue information from LPD/LPR compatible hosts that do not have LP Plus installed. The resulting status information from the remote host is displayed as is.
LP Plus hosts can be managed remotely from the Status and Control menu of another LP Plus host or from a WinPrint client. This includes both print queue and printer commands and status information. The network status server (dccbkst) must be active on any host being managed from another LP Plus host or from a WinPrint client.
Remote Management From the Status and Control Menu (dccstat)
The Status and Control menu (dccstat) can access other LP Plus hosts and transparently get status information and issue commands across the network. The screen will look the same except of the "host" indication in the upper left corner will indicate which host is being controlled (see next page). Commands are issued just like they are for the local host. This remote access is available from the Status and Control main menu as well as the Printer Status and Control menu and applies to the print jobs as well as the printers. Remote hosts can be accessed and controlled on a single remote printer basis, all print jobs for all remote printers locally defined, or an entire remote host. Following is a description of each method.
SELECT AN ENTIRE REMOTE HOST
Remote hosts refer to other UNIX hosts that also have LP Plus installed. By selecting "Remote Hosts" from the "Lookup" dialog, a list of remote hosts is displayed (below). A remote host is displayed if there is an entry in the "$LPHOME/security/rmhosts" file or at least one printer on the local host is defined in the LP Plus Administration system (dccadmin) as an "LPPlus" type on the remote system. An example of this is a local printer called "hpsys1" which uses the mode "LPPlus" with a UNIX device name of "hp!ptr4" (host_name!remote_printer_name). Because the host name "hp" is used in the device name for local printer "hpsys1" it appears in the remote host dialog.

By selecting the host "hp" the Status and Control screen changes to reflect the new hosts print jobs (next page), except for viewing reports (the "v" command) and accessing the remote systems log file (the "l" command) all other print job and printer commands are available and are performed the same way as if the print jobs and printers were on the local system. To return to the local host, press the <ESC> key.
SELECT ALL REMOTE PRINTERS (LOCALLY DEFINED)
Another method of accessing a remote LP Plus host, which narrows the number of print jobs and printers displayed, is by selecting "Switch Remote Host All Printers" from the Status and Control menu. This selection will display all printers or print jobs (depending on whether the command is executed from the Status and Control menu or the Printer Status menu) for printers that are locally defined in the LP Plus Administration system (dccadmin) as an "LPPlus" type on the remote system.
An example of this is a local printer called "hpsys1" which uses the mode "LPPlus" with a UNIX device name of "hp!ptr4" (host_name!remote_printer_name). Because the mode is "LPPlus", an attempt will be made to communicate with the host "hp" and get printer or print job status for all of the printers on host "hp" that are defined to the local host. If there are three local printers defined that send print jobs to queues on the host "hp", then those printers or the print jobs queued to the printers will be displayed and can be controlled.
To "switch" to the remote host and look at all of the print queues on the host that are locally defined, position the cursor on any of the remote print jobs (or printers) and use the Command menu selection "6=Cmds" or the corresponding hot key "x". The screen will then display all the remote hosts print jobs and printers that are defined to the local host. Press <ESC> to return to the local hosts information.
SELECT A SINGLE REMOTE PRINTER
The method of accessing a remote LP Plus host, to only display a single remote printer and print jobs, is by selecting "Switch Remote Host This Printer" from the Status and Control menu. This selection will display only one printer and its print jobs (depending on whether the command is executed from the Status and Control menu or the Printer Status menu) for printers that are locally defined in the LP Plus Administration system (dccadmin) as an "LPPlus" type on the remote system.
An example of this is a local printer called "hpsys1" which uses the mode "LPPlus" with a UNIX device name of "hp!ptr4" (host_name!remote_printer_name). Because the mode is "LPPlus", an attempt will be made to communicate with the host "hp" and get printer or print job status for the selected printer on host "hp" that is defined to the local host.
To "switch" to the remote host and look at a single print queue on the host that is locally defined, position the cursor on the desired remote print job (or printer) and use the Command menu selection "6=Cmds" or the corresponding hot key "y". The screen will then display the remote hosts print jobs and printers that are defined to the local host. Press <ESC> to return to the local hosts information.
Remote Management From a WinPrint Client
LP Plus print queues and printers can also be managed using WinPrint running on a Windows 3.1, 95, or NT client. WinPrint allows Windows clients to do bidirectional printing to and from UNIX and control the LP Plus print queues and printers using a Windows GUI (see below and next page).
Print queues and printers can be managed based on a single LP Plus print queue or all queues and printers can be managed on a per host basis. Only the network status server (dccbkst) needs to be running in order for WinPrint to manage the host. Refer to the WinPrint User Guide and Technical Reference for information on controlling LP Plus printers and print queues on UNIX from a Windows client.
Event processing in LP Plus refers to the ability to watch for a something to occur within LP Plus (e.g. printer goes disabled, print job fails, etc.) and then optionally performing a function based on the event. The action can be anything you like including sending a message to a Windows client via WinPrint (see WinPrint Client Messaging later in Part 4). Specific events have been set up so that when they occur, variables are passed and a shell script is executed ($LPHOME/event/script_name). These shell scripts are tied directly to an event. NOTE: The names of these scripts must not be changed. The event scripts are completely customizable so there is a great deal of flexibility with what can be done when an event occurs. Below is a description of the events and the shell scripts that are executed when they occur. The event scripts are all found in the $LPHOME/event directory.
| EVENT | SCRIPT |
| A print job has failed either before printing began or during. The print job will be marked interrupted (intrd) and the printer will be disabled. | writefail.sh |
| A network printer has failed connection. This means LP Plus tried to initially connect to the printer and start printing but failed. That can happen if the printer or network is down. | connectfail.sh |
| A printer has been disabled. This can happen either by a user or it will automatically happen when a print job fails before printing begins or during printing. | disable.sh |
| A print job has been submitted to a printer that is disabled. The print job will be spooled into LP Plus but will not print until the printer is enabled. | prtunavail.sh |
| A printer has been enabled. This can happen only by executing the dccenable command from dccstat or the command line. | enable.sh |
| A print job requires a form that is not mounted on the printer. The print job goes to a status of form pending (fpend). | formpending.sh |
| A new form has been mounted on a printer. | formmount.sh |
| A printer interface script has completed. This occurs for all printers when any print job attempts to print (despool). | interface.sh |
| A print job has been purged from the LP Plus queue system. This happens after a print job is canceled or has printed and after the printers purge delay time has elapsed. | purge.sh |
EXAMPLE 1
An example of how to use event processing is if the system administrator wanted to be alerted anytime a printer is disabled. This would be done using the "disable.sh" script (shown below) because anytime a printer is disabled this event script is executed. To be alerted via a WinPrint message when any printer is disabled, only the alert command is required in the event script.
################# Disable Event Script ####################################
####
#### The following environment variables are available to
#### this script:
#### PRINTER
$LPHOME/bin/dccwinnotify pchost " ${PRINTER} has been disabled!"
exit 0
#########################################################################
In this example, the Windows client "pchost" running WinPrint is sent the message "printer_name" has been disabled! (see below) whenever any printer is disabled.
EXAMPLE 2
This example shows how to move a print job that has been spooled to a specific disabled printer to a new printer (perhaps you have a printer that is prone to failing). This is done by first knowing the print job has spooled to the disabled printer using the "prtunavail.sh" event script (see next page). This script gets executed anytime a print job spools to a disabled printer.
################# Request queued for disabled printer ########################
####
#### The following environment variables are available to
#### this script:
#### PRINTER
#### REQUEST_ID
if [ "$PRINTER" = "printer4" ]
then
$LPHOME/bin/dcclp -i {$REQUEST_ID} -d printer8
fi
exit 0
########################################################################
In the above example, anytime a print job gets spooled to "printer4", when the printer is disabled, the event script moves the print job "$REQUEST_ID" to printer8.
WinPrint client messaging is how LP Plus on a UNIX host sends messages to a Windows 3.1, 95, or NT clients. WinPrint allows Windows clients to do bidirectional printing to and from UNIX and control the LP Plus print queues and printers using a Windows GUI (see below and next page).
With more UNIX users running Windows clients on their desktop than ever before, UNIX applications have had to accommodate these clients and their interface. UNIX based client/server applications and users who run Windows applications along with UNIX applications have made it necessary to have very tight interoperability between UNIX and Windows. LP Plus is no exception.
WinPrint running on the Windows client and LP Plus on a UNIX host allows messages to be sent from the LP Plus on the UNIX host to the Windows client. An example of use is the event processing example (see Event Processing previously in Part 4) where the Windows user is alerted that an event has occurred on the UNIX host.
Another example of a use for WinPrint is to send a message to a Windows user informing that their print job has printed. This alerts a user that their print job has printed and they may want to walk to the printer (see below).
The command that sends the message to WinPrint is "dccwinnotify". This command can be executed from the command line. Its usage is:
$ dccwinnotify host_name "message text"
An example is ($ dccwinnotify mikepc "You have spooled a print job to disabled printer lp0"). The host_name in this case "mikepc" has an entry in the "/etc/hosts" file and has WinPrint installed and running on the Windows client. In the WinPrint general settings the pop up messaging is enabled (see below) and the client is listening to the correct TCP port number.
Client messaging can be a valuable tool for alerting administrators and users of printing issues and, when used in conjunction with event processing and LP Plus, help make UNIX printing less problematic.
Report Segmenting and Distribution
LP Plus Version 3 has a new form type called advanced forms. This type of form is used to segment reports (split them to multiple printers), apply multi-part FlexForm electronic forms to segments, split reports into even segments automatically and to print multiple copies of reports to different printers simultaneously. Advanced forms are accessed using the "dcclp -f form_name" command line or from the Status and Control menu "dccstat".
These advanced forms are setup using LP Plus Administration. As briefly mentioned above, there are several distinct uses for advanced forms including:
- Split a print job into multiple equal segments and spool them to different printers.
- Split a print job into multiple segments based on page numbers and spool them to different printers.
- Print complete copies of a print job to several printers simultaneously.
- Apply FlexForm electronic forms to any print job or segments.
![]()
Using the advanced form configuration screen (above) as described in the Advanced Forms section of Part 3, many different combinations of segmenting can occur. By selecting the appropriate LP Plus printer names and segment actions (Pg field), any of the above scenarios for segmenting and distribution can be achieved. The segment actions are described below:
"All" - Sends all of the original spooled print job to this segment.
"Split" - Sends an equal amount of the original print job to this segment. For example, if there are 3 segments the original print job is split into thirds.
"Number of Pages" - The last page number to print for this segment. The starting page number is based on the previous segments ending page or the beginning of the print job for the first segment. An example would be if you wanted pages 1 to 100 to print to segment 1, pages 101 to 200 to print to segment 2, and pages 201 to 300 to print to segment 3. The "Pg" field for each segment would be 1. Pg[100 ],
2. Pg[200 ], 3. Pg[300 ].
Another aspect of an advanced form is the ability to apply FlexForm electronic forms to a segment. FlexForm is an electronic forms software product also from Digital Controls. It allows you to create and/or replace preprinted forms with electronic forms overlays printed to laser printers, bar codes, multi-part forms, forms distribution, and more. FlexForm also integrates with UNIX fax software to provide a complete and professional image for your company. These are added to segments in the "FFE" field. Several examples of FlexForm are distributed with LP Plus.
LP Plus has a resource accounting log that provides printer usage information. This information can be used for charging users or departments for usage or tracking for other purposes. A record is added to the $LPHOME/messages/acctlog file for each print request that is printed. A record will be present for each report printed and each copy of that report. In the case of network printing, all copies will show on one
accounting record (e.g. a 10 page document with 10 copies printed to a network device will show 100 pages printed).
Account logging is turned off and on from LP Plus Administration (dccadmin). Select "System Defaults" from the "Setup" menu and then press the function key <F1> or (<CNTL> + f then 1) to move to the second screen. The entry at the bottom of the screen "Should the ACCOUNTING subsystem be enabled [n]" is displayed. The accounting system is turned off by default. To turn the accounting system on, press "y" in the field and then update (save) the default settings by pressing the function key <F3> or (<CNTL> + f then 3).
The accounting record contains 10 string fields delimited by the comma character. Each record contains:
1. Date and Time Stamp
2. Request ID
3. User Name
4. Destination
5. Report Title
6. Form Name
7. Number of Pages (zero if page counting not done)
8. Number of Characters
9. Print Time in Seconds
10. Exit Code (the exit code numbers are as follows)
0 -Good, 3-Read fail, 5-Write fail, 7-Dropped carrier (serial), 8-Interrupted, 9- Bad parameter count, 10-Cancelled, 11-Suspended, 13-Unable to connect
EXAMPLE
Fri Jul 21 11:38:47 1996 ,RID0169,tomp,lp0,Billing21,invoice,1,905,2,0
Submitting Print Jobs through a Directory
For applications that do not print through the "lp" command, LP Plus can "look" at directories and print files as they arrive. This is done with the "dccscan" command. Dccscan runs in the background and periodically checks for new files to be written to a specified directory. When a file arrives, dccscan submits the file as a print job using the "dcclp_options" specified when dccscan was executed. After the file is successfully submitted to the LP Plus queue system, dccscan removes the original file. Below is a description of the dccscan command with some examples of usage. To stop dccscan the process must be killed.
dccscan directory_path cycle_time delay_time "dcclp_options"
directory_path - The full pathname to an existing directory to scan for files.
cycle_time - The "cycle_time" refers to the number of seconds between "scans" to see if a file is in the directory, i.e., how often to check for new files.
delay_time - The amount of time in seconds to delay after the file is no longer being written before spooling begins. This ensures the application is finished writing the file before LP Plus spools the print job.
"dcclp_options" - The options to use when printing the file. These must be valid "dcclp" options.
EXAMPLE
$ dccscan /tmp/dir 30 5 "-d printer4 -h -s -o nopurge"
This example looks in the directory "/tmp/dir" every 30 seconds for new files. It will check every 5 seconds after the file is initially found to determine when the file is no longer being accessed by another application. It will then submit the print job to "printer4", place the job on hold "-h", use the silent option "-s", and set the job to not purge "-o nopurge" after printing.