root / pykota / trunk / README @ 1154

Revision 1154, 13.8 kB (checked in by jalet, 21 years ago)

New features list

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1# $Id$
2
3PyKota - Print Quota for CUPS and LPRng
4
5(c) 2003 Jerome Alet <alet@librelogiciel.com>
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19
20====================================================================
21
22READ SPECIAL LICENSING AND REDISTRIBUTION TERMS IN THE FILE 'LICENSE'
23
24====================================================================
25
26PyKota features :
27-----------------
28
29    Operating systems :
30   
31        - Any Unix-like system as print server.
32           
33        - Any operating system as client.
34           
35    Printing systems :
36   
37        - Supports CUPS as the printing system.
38       
39        - Supports LPRng as the printing system.
40           
41    Databases :
42   
43        - Supports PostgreSQL as the Quota Storage backend.
44          Complete database creation SQL script is included.
45       
46        - Supports OpenLDAP as the Quota Storage backend.
47          Complete LDAP schema and sample tree are included.
48           
49    Printers :       
50   
51        - Supports any printer which can report its internal
52          page counter.
53         
54        - Supports any other printer via GhostScript.
55       
56        - Can ask printers for their internal page counter
57          via SNMP, Netatalk, or any other mean of your
58          choice. This is completely configurable.
59         
60        - External accounting methods are configurable 
61           
62    Quota systems :       
63   
64        - Supports user and groups quotas.
65       
66        - Supports page quotas.
67          Page quotas can be set differently on a per printer
68          and per user/group basis.
69       
70        - Supports account balance quotas in any currency.
71          Account balance quotas can be set on a per user
72          basis. The account balance is shared amongst
73          all printers.
74         
75        - Experimental support for printer groups, so that
76          you can share quota between printers of the same
77          type but in different locations.
78         
79        - Page quota and account balance can be set/reset
80          independantly.
81         
82        - Limiting factor, page quota or account balance, 
83          can be set on a per user or per group basis.
84         
85        - Price per page and per job can be set differently 
86          on any printer.
87       
88        - Low level of page quota or account balance are
89          configurable.
90         
91        - Both soft and hard limit with configurable grace delay 
92          can be set for page quota.
93         
94        - Possibility to disable quota enforcement for any user
95          or group, while still keeping page accounting.
96             
97    Administration :       
98   
99        - Powerful administration tools can be used to
100          automate setting or resetting of quotas or
101          account balances at specific intervals.
102         
103        - Administration tools can modify several users, 
104          groups, or printers at once.
105         
106        - Account balances can be set, incremented, or 
107          decremented.
108         
109        - Users can be automatically added on first print 
110          in a completely configurable way.
111         
112        - Quota report generator available either from the 
113          command line or in any web browser.
114          The web-based quota report generator can be
115          user/password protected.
116         
117        - Print quote generator can tell users how much 
118          a print job will cost them in advance.
119         
120        - Policy with regard to unregistered users can   
121          be configured for each printer to either deny
122          printing, allow printing, or delegate the
123          decision to any external tool.
124         
125        - Warning and error messages can be automatically 
126          sent via email to the administrator, the user,
127          both, or none.
128         
129        - Warning and error messages' content is completely
130          configurable.
131         
132        - Configuration can be changed without needing to 
133          restart the printing system.
134       
135        - Complete print job history is kept. This can be
136          disabled if needed.
137         
138        - Automated low quota or balance remainder can be
139          scheduled regularly or launched manually.
140         
141        - All the command line tools accept the -h | --help
142          command line option which prints all the available
143          options and show usage examples.
144
145====================================================================
146       
147Planned features are described in the TODO file.
148
149Actually three (or an infinity of) page accounting methods are
150implemented :
151
152  - The 'querying' method consists in querying the printer (via SNMP
153    or Netatalk) for its total pages counter, just before the beginning
154    of a job, and use this to modify the *preceding* user's quota. So
155    you're always late of one print job, but this is generally ok,
156    especially because a check is also done to see if the current user
157    is allowed or not to print. You're not limited to SNMP or Netatalk,
158    because you can also use any external command instead if you want.
159   
160  - The 'external' method consists in delegating the computation of the
161    job's size in number of pages to any external command of your choice.
162    The command can read the job's data from its standard input and MUST
163    output the job's size on its standard output.
164   
165  - The 'stupid' method consists in counting the 'showpage' PostSript 
166    statements in the job. THIS IS UNRELIABLE, but can serve as an
167    example if you plan to write your own accounting method for
168    integration into PyKota.
169 
170PyKota is known to work fine with HP Laserjet 2100 and 2200, and
171Apple LaserWriter 16/600 PS, both with CUPS and LPRng, under
172Debian GNU/Linux (Sarge and Sid) operating systems.
173
174I'm interested in receiving success or failure reports with other
175brands or models of printers, as well as with other operating
176systems.
177
178============================================================
179
180INSTALLATION:
181=============
182
183WARNING :
184=========
185
186  If you run a PyKota version lower than 1.03, you definitely have to
187  upgrade you Quota Storage Database. Please read the documentation
188  included in the initscripts subdirectory first !
189 
190  Users of MacOS-X may find the following tutorial useful :
191
192      http://ell-tech.com/pages/pykota.php
193
194Prerequisite :
195--------------
196   
197  You need to have the following tools installed on the CUPS Server :
198 
199    - CUPS or LPRng
200    - Python v2.1 or above
201    - eGenix' mxDateTime Python extension
202    - SNMP tools (specifically the snmpget command) if you plan to
203      request your printer's lifetime page counter via SNMP.
204    - Netatalk (specifically the pap command) if you plan to
205      request your printer's lifetime page counter via AppleTalk.
206    - PostgreSQL's PygreSQL Python extension and the PostgreSQL client
207      libraries if you plan to use PostgreSQL as the Quota Storage
208      backend.
209 or     
210    - python-ldap Python module and the OpenLDAP client libraries 
211      if you plan to use OpenLDAP as the Quota Storage backend.
212   
213  You need to have the following tools installed on the Quota Storage 
214  Server :
215 
216    - PostgreSQL
217   
218  or 
219 
220    - OpenLDAP
221   
222NB :   
223
224  PygreSQL must be linked with the PostgreSQL client libraries on
225  the Print Server. The PostgreSQL client libraries' version must
226  match the PostgreSQL version used on the Quota Storage Server.
227 
228or 
229
230  python-ldap must be linked with the OpenLDAP client libraries on the
231  Print Server. The OpenLDAP client libraries' version must match the
232  OpenLDAP version used on the Quota Storage Server.
233 
234  This list of prerequisite software may change in the future, when
235  PyKota will support more functionnalities you will be given
236  alternatives.
237 
238  Of course the Print Server and the Quota Storage Server can be the
239  very same machine if you've got a tiny network, or you can have
240  multiple Print Servers all storing their quotas on the same Quota
241  Storage Server if you've got a bigger network.
242 
243Then :   
244------
245 
246Download the latest PyKota version from the CVS tree on :
247
248    http://savannah.nongnu.org/projects/pykota
249
250Just type :
251
252    python setup.py install
253
254You may need to be logged in with sufficient privileges (e.g. root)
255
256The installation script will now automatically check if some software
257is missing and ask you if you still want to proceed with the
258installation or abort it completely.
259
260Go to the initscripts subdirectory of PyKota's sources, and choose
261the appropriate storage backend for your configuration. Read
262the associated README file and execute the initialization script
263to create an empty PyKota Storage. Upgrade scripts may be
264provided as well.
265
266Copy the conf/pykota.conf.sample and  conf/pykotadmin.conf.sample
267sample configuration files to /etc/pykota/pykota.conf and
268/etc/pykota/pykotadmin.conf. The installation script tries to do this
269for you if needed and you agreed to this action.
270You need to adapt these files to your own needs.
271Especially you have to create sections named after your own
272printers, and change the administrator's email address.
273
274  - CUPS Print Backend :
275 
276    Modify the PPD files for each printer on which you want to manage
277    print quotas, for example /etc/cups/ppd/lp.ppd :
278   
279    --- Add the line below exactly as-is somewhere near the top ---
280    *cupsFilter:  "application/vnd.cups-postscript 0 /usr/bin/pykota"
281    --- Add the line above exactly as-is somewhere near the top  ---
282   
283    Modify the path to the pykota executable if needed, unfortunately
284    you have to supply the correct absolute path here due to CUPS
285    internals, or put the pykota executable into /usr/lib/cups/filter
286    instead of into /usr/bin.
287   
288    Do this for each ppd file present in this directory if you want
289    to enable quota on every printer.
290             
291    WARNING : In the case you've got a non-postscript printer, chances
292              are that the *cupsFilter is already filled-in and points
293              to cupsomatic or such a print filter. In this case please
294              check if you can switch your printer to PostScript mode
295              or if there's a way to make it accept PostScript jobs.
296              If yes then ensure that your workstations uses a PostScript
297              printer driver, and replace the *cupsFilter line with the
298              one pointing to the pykota filter. This should work, but
299              is currently untested.
300              If your printer really needs the original *cupsFilter line
301              then you may not be able to use PyKota easily for now.
302
303  - LPRng Print Backend :
304 
305    Modify the /etc/printcap file to add two lines identical to these ones :
306   
307    :achk=true
308    :as=|/usr/bin/pykota
309   
310    For each printer on which you want to use print accounting.
311 
312Add printers and users to the quota system and set their quota values :
313
314    $ edpykota --add -P hp2100 -S 40 -H 50 user1 ... userN
315       
316    launching edpykota without any argument or with the --help
317    command line option will show you all the possibilities.
318   
319    by default, each user is limited by "quota", this means that on
320    each printer he can have a different soft and hard limit.
321    You may want to limit the user by his account balance value,
322    in which case, the print quota is shared between all printers
323    instead of being different. To do this, use the following :
324   
325    $ edpykota --add -P hp2100 --limitby balance --balance 10 user1 ... userN
326   
327    This will put 10 $ (or Euros, PyKota doesn't care) on each user's account
328    balance, and tell PyKota to limit them by their account balance value.
329    Whenever they print on any printer, their account balance value is
330    decreased by an amount which depends on the particular price per page
331    and per job that you may have defined on the printer with edpykota's
332    --charge command line option.
333    Soft and Hard limits are not used if "--limitby balance" is used,
334    but you can define a "poorman"'s threshold in /etc/pykota/pykota.conf
335    to obtain a similar result (warning message when quota is low).
336
337Restart CUPS or LPRng, for example under Debian GNU/Linux systems :         
338
339    $ /etc/init.d/cupsys restart
340   
341  or :
342 
343    $ /etc/init.d/lprng restart
344       
345Your users now should be able to print but not exceed their
346printing quota.
347
348To see printer quota usage, you can use :
349
350    $ repykota --printer lp
351   
352or :
353
354    $ repykota
355   
356    which will print quota usage for all users on all printers,
357    along with totals, if you are the root user. If you are
358    a regular user, only your own quota report will be produced.
359   
360Quota reports are also available remotely by using the CGI script
361printquota.cgi provided in the cgi-bin/ subdirectory.
362
363For different security concerns, please give a look at the SECURITY
364file which is part of this software.
365           
366============================================================
367
368Mailing list :
369--------------
370
371  A mailing list is dedicated to Pykota, you can subscribe to it
372  or consult its archives at :
373 
374    http://cgi.librelogiciel.com/mailman/listinfo/pykota
375   
376============================================================
377   
378Please e-mail bugs to the mailing list at : pykota@librelogiciel.com
379or to the main author at : alet@librelogiciel.com (Jerome Alet)
Note: See TracBrowser for help on using the browser.