LPRngInfo for Win32 (NT/2000/xp)
Version 1.5
Copyright 2000-2005 University of Wisconsin - Madison, CAE Center
Obtaining LPRngInfo
There are two versions of LPRngInfo available. One version contains support
for getting status information of HP printers via SNMP. The other, version does
not contain this support and does not require two additional DLL files.
The HP Printer Status version uses SNMP++ which is open source found at:
http://rosegarden.external.hp.com/snmp++/index.html
The copyright information for SNMP++ is:
Copyright © 1994-1996 Hewlett Packard Company
All Rights Reserved
Hewlett Packard
Peter Erik Mellquist
The SNMP_PP.DLL is included with the distribution of LPRngInfo. This DLL
requires the WinSNMP library (WSNMP32.DLL). An evaluation version can be
obtained from ACE*COMM at http://www.acecomm.com/.
Overview
LPRngInfo is a WinNT/2000 utility that will allow you to view and slightly
manage your Unix based print queues. This program assumes you are using LPRng
for your print system. Geared mainly for our helpdesk, this program presents a
easy to use GUI environment to display the print activity on our Unix system.
The main window (shown below) allows you to see at a quick glance a summary of
print queues. The LPRng print queues listed can come from multiple hosts if
desired.

Viewing the Queue
By double-clicking on a queue entry, or selecting an entry and pressing the Show
Jobs button, the program will bring up the list of jobs in the specified
queue as well as some LPRng Status information. From this window, you can delete
print jobs. The program will obtain the NT user name of the person logged into
the machine and send that name in the request to LPRng to delete a job.
The user must have rights on the remote system to be able to delete a job. If
they don't, you will get an error.
As with the main window, the list will auto-refresh every so often
(configurable). The user also has the option to force a refresh by pressing the Refresh
button.

Support for HP Printers
One version of the program has support for getting status information from HP
printers via SNMP. This version requires two additional DLLs (see Obtaining
LPRngInfo for details). When enabled, the program will query the specified
printers via SNMP and obtain the status information (Out of paper, Toner Low,
Paper Jam, etc). This process has been placed into the background as it can take
a long time to refresh the display if the list of printers is long. Once
the background thread polls all the printers, it will pause for a configurable
amount of time before starting to poll all the printers again.
The program uses HP's SNMP++ which uses WinSNMP.

System Requirements
There are two requirements for this program. This program was written to work
with Windows NT (uses user security information to obtain the currently logged
in user. If someone has a better way of doing this so it will work on Windows9x
and NT/2000, feel free to modify the source and send me the update). It may work
under Win9x, but I have not tested it.
The other requirement is that you use LPRng for your print system. LPRngInfo
relies on the output from LPRng to populate the windows with information. LPR
daemons for the various Unix systems will differ in the output and can't be
used. This has been tested with LPRng version 3.5.3.
Installing and configuring LPRngInfo
Installation is fairly simple. You need to place the executable and its
config file LPRngInfo.cfg in the same directory. Edit the LPRngInfo.cfg
file to your liking. If you are using the HP Printer Supported version, you also
need to copy the DLL files SNMP_PP.DLL and WSNMP32.DLL to the same directory as
the application (or they could be in the system's path).
LPRngInfo.cfg
The config file is fairly simple. Any line starting with a pound sign (#) is
treated as a comment. The rest of the config file is formated like most windows
INI files.
[options] section
In this section, you can set up a few items to control the program's
behaviour. The options are fairly self explanitory:
- AutoRefresh = <value>
This enables/disables the program's automatic refresh of the displayed
information. If for some reason you don't want to have the program update on
its own and just use the refresh buttons, you can disable it here.
If this value is set to a 1 or Y, then it is enabled. Any
other value disables AutoRefresh
- QueueRefreshTime = <value in seconds>
Specifies the number of seconds to wait before updating the display. The
value is specified in seconds. For this to work, you need to enable the
AutoRefresh option.
- QueuJobRefreshTime = <value in seconds>
This is the amount of time to wait between updating the information in the
queue job list. This way, you can have that window update more frequently
than when viewing the entire queue summary.
- ShowErrorJobs=<value>
This setting will show or hide jobs with errors. These jobs are not
considered by LPRng to be printable. Often they happen when there was a
timeout from the printing client transferring the print job into the queue.
A value of 1 or Y will enable the display of the error jobs in
the queue.
- UseNTUserName=<value>
This specifies if the program should use the user name of the person logged
into the machine as the name to be sent to the remote LPR daemon when making
a delete request. A value of 1 or Y will have the program use
the logged in user. If not, be sure to specify a user with the RemoteUserName
option.
- RemoteUserName=<value>
The name of the user to send with the delete a job request. If UseNTUserName
is not set, then this will be the name of the user to send.
- ShowHPStatus=<value>
If using the SNMP enabled version, you can disable the display of the
printer status information. Setting this value to 1 or Y will
enable the display and start the background polling thread. This was added
prior to me deciding to distribute two versions (one of which doesn't
require the extra DLL files)
- HPPrinterSTatusRefreshTime=<value in seconds>
The amount of time to wait before starting an update of the printer
information via SNMP.
- FetchQueueModeInDebug=<value>
Fetch the list of queue entries via the long debug mode. This is more
accurate as the other way has problems with the jobid field if the user
name gets long. Made this an option in case the version of LPRng doesn't
support it. Setting the value to 1 or Y enables it, a value
of 0 or N disables it.
- PerformanceBoost=<value>
When this option is selected, the program will make a single request
to the LPRng server for the queue info. With this option turned off,
the program will connect to the LPRng server once for each queue in
the list. Setting the value to 1 or Y enables it, a value
of 0 or N disables it.
- DisplayPrinterStatus=<value>
Turns on or off the "printing" column. This is a new column starting
in versino 1.5 that will display if the queue is allowed to send
spooled jobs to the printer. Setting the value to 1 or Y enables it, a value
of 0 or N disables it.
- DisplaySpoolerStatus=<value>
Turns on or off the "spooling" column. This is a new column starting
in version 1.5 that will display if the queue is allowing the spooling
of print jobs.S etting the value to 1 or Y enables it, a value
of 0 or N disables it.
An example of these options is below:
[Options]
AutoRefresh = 1
QueueRefreshTime=60
QueueJobRefreshTime = 30
ShowHPStatus=0
HPPrinterStatusRefreshTime=60
ShowErrorJobs=0
UseNTUserName=0
RemoteUserName=root
FetchQueueModeInDebug=1
PerformanceBoost=1
DisplayPrinterStatus=1
DisplaySpoolerStatus=1
[printers] section
This is the section where you define the printers. The format of the entries
in this section is:
<print queue>@<hostname>
If you are using the HP version, then the format of the line changes just
slightly to allow you to specify the hostname of the actual printer. The format
is:
<print queue>@<hostname>:<hp printer hostname>
Both formats can be used in either version of the program. In the non-SNMP
aware version, the hp printer host information is just ignored.
For example, if you had two Unix systems with LPRng installed. One one system
(unix1.mydomain.org) you have the print queues my_laser and hp_laser
configured and on the other (unix2.mydomain.org) you have the print queue local_printer.
The printers my_laser and hp_laser are HP printers with JetDirect
cards in them. The hostname for my_laser is myprinter.mydomain.org and
the hostname for hp_laser is hpprinter.mydomain.org. The config file
would look like the following for this setup:
[printers]
my_laser@unix1.mydomain.org:myprinter.mydomain.org
hp_laser@unix1.mydomain.org:hpprinter.mydomain.org
local_printer@unix2.mydomain.org
Version History
Version 1.5
- BUGFIX: Sometimes the HP Printer status string was incorrect
- Added the ability to show a queues printing and spooling status
- Changed the enabling/disabling of the print queue as one option
(chaging both the printing and spooling status) to letting the
user selectivly disable/enable spooling or printing
- Added the ability for the program to query the queue in a more
verbose mode to get the job list. Needed if the username of the
print job gets long, the list returned from the LPRng server
tends to mangle the jobid field.
- Added the ability to have the program query multiple queues
status from the same LPRng server in a single query instead of
doing multiple queries.
Version 1.4
- BUGFIX: String parsing fixes contributed by Rabellino Sergio
- CHANGE: Program Icon contributed by Rabellino Sergio
- Added the ability to select multiple print jobs for deleting
- Added the ability to up/down a printer
Version 1.3
- Added the ability to hold and release queue jobs
Version 1.2b
- BUGFIX: background timers were not getting turned off when the config file
said "no auto update"
- Added the ability to specify the user name for the delete request in the
config file.
- Source code made available starting with this release. Source is available
under the Artistic License.
Version 1.2a
- BUGFIX: Changed the way the program finds its config file. It used to look
in the "current working directory", and now it looks at the
directory where the .EXE is located.
- Created a separate build that didn't require the SNMP_PP.DLL and
WSNMP32.DLL
Version 1.2
- Added SNMP polling of HP Printers
- Added ability to remove jobs from a queue (if remote side lets you)
- Added ability to configure the program via LPRngInfo.CFG. No longer hard
coding in all the printer information
- BUGFIX: Clicking on "Show Jobs" when no item was selected
resulted in a GPF.
Version 1.1
- Changed the way the print queue jobs are displayed. It is now shown in a
multi-column list box
- Added timers to enable auto-refresh of the display
Version 1.0
- Initial writing of the program
File: http://www.cae.wisc.edu/~drews/lprnginfo/readme.html