Usage
In LPRng's printcap file create an entry like
lp
:lp=/dev/null
:filter=/usr/local/libexec/fsnmp
The LPRng print system opens /dev/null as output device
and assigns it as standard output to the print filter.
The fsnmp filter reads it's configuration from the
fsnmp.conf file.
In ${prefix}/etc/fsnmp.conf create an entry
[lp]
lp = 192.168.1.99%9100
snmp version = 1
snmp community = public
ctrl-d at end = yes
shutdown data socket = no
minimum pagecount time = 30
shutdown accounting socket = yes
- lp
The host name and port number of the printer. Host name (or IP address)
and port number are separated by '%'.
- snmp version
The SNMP version, may be 1, 2c, 2p or 3.
- snmp community
The SNMP community. The enry in the configuration file must match
the setting on the printer.
- ctrl-d at end
Boolean option, may be "yes" or "no". Some printers -- especially
PostScript printers -- use a Control-D (ASCII character 0x04) as
end of job indicator. If this option is enabled fsnmp makes
sure to send a Control-D as last character to the printer (if the last
character in the filter input is not a Control-D, fsnmp appends
a Control-D).
- ctrl-d at start
Boolean option, may be "yes" or "no". A Control-D at job start
may be used to initialize the printer (it means: end of previous job,
reset to default settings). In most cases this option is unnecessary.
- Data transfer port range
Two numeric values (separated by spaces) to choose a range of local port numbers
to use when connecting to printer.
- shutdown data socket
Boolean option, may be "yes" or "no". If this option is enabled fsnmp
attempts to do a clear TCP/IP shutdown of the data socket. This means
fsnmp shuts down the socket for writing and attempts to read from the
socket until a "no more data available" condition occurs.
Most printers do not handle socket shutdown properly, so this option
should be turned off. In this case fsnmp simply closes the socket
after transferring data.
- minimum pagecount time
When retrieving the pagecount after job transfer fsnmp waits for the
printer to indicate "ready" state via SNMP and to have a pagecount
larger than pagecount before job. It is possible (but really a special
case) to send PS jobs to the printer which do not increase
the pagecounter (nothing is printed). So we can set a timeout for wait
operations.
- accounting destination
String value where to send accounting data to. Must be one of the
following forms:
- filename
Accounting data is written to file.
- |command
The specified command is opened as a pipe, accounting data is fed as input
to the pipe command.
- host%port
Send accounting data over network to the specified host and port.
- accounting port range
When sending accounting data over network use a free port from the
specified port range (two numbers separated by spaces).
- shutdown accounting socket
This option should be turned on when sending accounting data over a
network connection. If fsnmp connects to some accounting
software to send pagecounter data, it should do a fine network
connection shutdown after sending data.