root / pykota / trunk / README @ 1260

Revision 1260, 15.6 kB (checked in by jalet, 20 years ago)

Added printers groups feature to 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-2004 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          Plugging PyKota into your existing LDAP infrastructure
49          is really easy thanks to PyKota's great configurability.
50           
51    Printers :       
52   
53        - Supports any printer which can report its internal
54          page counter.
55         
56        - Supports any other printer via GhostScript.
57          Depending on the printer some configuration may
58          be needed.
59       
60        - Can ask printers for their internal page counter
61          via SNMP, Netatalk, or any other mean of your
62          choice. This is completely configurable.
63         
64        - External accounting methods are configurable.
65           
66    Quota systems :       
67   
68        - Supports printers and printers groups quotas.
69       
70        - Supports users and users groups quotas.
71       
72        - Supports page quotas.
73          Page quotas can be set differently on a per printer
74          and per user/group basis.
75       
76        - Supports account balance quotas in any currency.
77          Account balance quotas can be set on a per user
78          basis. The account balance is shared amongst
79          all printers.
80         
81        - Page quota and account balance can be set/reset
82          independantly.
83         
84        - Limiting factor, page quota or account balance, 
85          can be set on a per user or per group basis.
86         
87        - Price per page and per job can be set differently 
88          on any printer.
89       
90        - Low level of page quota or account balance are
91          configurable.
92         
93        - Both soft and hard limit with configurable grace delay 
94          can be set for page quota.
95         
96        - Possibility to disable quota enforcement for any user
97          or group, while still keeping page accounting.
98             
99    Administration :       
100   
101        - Powerful administration tools can be used to
102          automate setting or resetting of quotas or
103          account balances at specific intervals.
104         
105        - Administration tools can modify several users, 
106          groups, or printers at once.
107         
108        - Account balances can be set, incremented, or 
109          decremented.
110         
111        - Users can be automatically added on first print 
112          in a completely configurable way.
113         
114        - Quota report generator available either from the 
115          command line or in any web browser.
116          The web-based quota report generator can be
117          user/password protected.
118         
119        - Print quote generator can tell users how much 
120          a print job will cost them in advance.
121         
122        - Policy with regard to unregistered users can   
123          be configured for each printer to either deny
124          printing, allow printing, or delegate the
125          decision to any external tool.
126         
127        - Warning and error messages can be automatically 
128          sent via email to the administrator, the user,
129          both, or none.
130         
131        - Warning and error messages' content is completely
132          configurable.
133         
134        - Configuration can be changed without needing to 
135          restart the printing system.
136       
137        - Complete print job history is kept. This can be
138          disabled if needed.
139         
140        - Automated low quota or balance remainder can be
141          scheduled regularly or launched manually.
142         
143    User Interface :         
144   
145        - All the command line tools accept the -h | --help
146          command line option which prints all the available
147          options and show usage examples.
148         
149        - Completely internationalized. Actually supports the 
150          English and French languages. More to come.
151
152====================================================================
153       
154Planned features are described in the TODO file.
155
156Actually three (or an infinity of) page accounting methods are
157implemented :
158
159  - The 'querying' method consists in querying the printer (via SNMP
160    or Netatalk or any other method of your choice) for its total pages
161    counter.
162   
163    With CUPS, this is done both at the beginning and at the end of a
164    print job. The counters difference is then immediately used to
165    decrease the user's account balance or increase his quota usage.
166   
167    With LPRng, this is done just before the beginning of a job, and used
168    this to modify the *preceding* user's quota. So you're always late
169    of one print job, but this is generally ok, especially because a
170    check is also done to see if the current user is allowed or not to
171    print.
172   
173  - The 'external' method consists in delegating the computation of the
174    job's size in number of pages to any external command of your choice.
175    The command can read the job's data from its standard input and MUST
176    output the job's size on its standard output. Changes to the user
177    account are reported immediately, both with CUPS and LPRng.
178   
179  - The 'stupid' method consists in counting the 'showpage' PostSript 
180    statements in the job. THIS IS UNRELIABLE, but can serve as an
181    example if you plan to write your own accounting method for
182    integration into PyKota. It basically works like the 'external'
183    method, but does the computation internally.
184 
185PyKota is known to work fine with HP Laserjet 2100 and 2200, and
186Apple LaserWriter 16/600 PS, both with CUPS and LPRng, under
187Debian GNU/Linux (Sarge and Sid) operating systems.
188
189I'm interested in receiving success or failure reports with other
190brands or models of printers, as well as with other operating
191systems.
192
193============================================================
194
195INSTALLATION:
196=============
197
198NB :
199====
200
201  Users of MacOS-X may find the following tutorial useful :
202
203      http://ell-tech.com/pages/pykota.php
204
205Prerequisite :
206--------------
207   
208  You need to have the following tools installed on the CUPS Server :
209 
210    - CUPS or LPRng
211    - Python v2.1 or above
212    - eGenix' mxDateTime Python extension
213    - SNMP tools (specifically the snmpget command) if you plan to
214      request your printer's lifetime page counter via SNMP.
215    - Netatalk (specifically the pap command) if you plan to
216      request your printer's lifetime page counter via AppleTalk.
217    - PostgreSQL's PygreSQL Python extension and the PostgreSQL client
218      libraries if you plan to use PostgreSQL as the Quota Storage
219      backend.
220 or     
221    - python-ldap Python module and the OpenLDAP client libraries 
222      if you plan to use OpenLDAP as the Quota Storage backend.
223   
224  You may also benefit from having the following tools installed to
225  deal with some printers :
226 
227    - npadmin
228    - netcat
229    - ghostscript
230   
231  You need to have the following tools installed on the Quota Storage 
232  Server :
233 
234    - PostgreSQL
235   
236  or 
237 
238    - OpenLDAP
239   
240NB :   
241
242  PygreSQL must be linked with the PostgreSQL client libraries on
243  the Print Server. The PostgreSQL client libraries' version must
244  match the PostgreSQL version used on the Quota Storage Server.
245 
246or 
247
248  python-ldap must be linked with the OpenLDAP client libraries on the
249  Print Server. The OpenLDAP client libraries' version must match the
250  OpenLDAP version used on the Quota Storage Server.
251 
252  This list of prerequisite software may change in the future, when
253  PyKota will support more functionnalities you will be given
254  alternatives.
255 
256  Of course the Print Server and the Quota Storage Server can be the
257  very same machine if you've got a tiny network, or you can have
258  multiple Print Servers all storing their quotas on the same Quota
259  Storage Server if you've got a bigger network.
260 
261Then :   
262------
263 
264Download the latest PyKota version from the CVS tree on :
265
266    http://savannah.nongnu.org/projects/pykota
267
268Just type :
269
270    python setup.py install
271
272You may need to be logged in with sufficient privileges (e.g. root)
273
274The installation script will now automatically check if some software
275is missing and ask you if you still want to proceed with the
276installation or abort it completely.
277
278Go to the initscripts subdirectory of PyKota's sources, and choose
279the appropriate storage backend for your configuration. Read
280the associated README file and execute the initialization script
281to create an empty PyKota Storage. Upgrade scripts may be
282provided as well.
283
284Copy the conf/pykota.conf.sample and  conf/pykotadmin.conf.sample
285sample configuration files to /etc/pykota/pykota.conf and
286/etc/pykota/pykotadmin.conf. The installation script tries to do
287this for you if needed and you agreed to this action. You need to
288adapt these files to your own needs. Especially you have to create
289sections named after your own printers, and change the
290administrator's email address which by default is root@localhost.
291Read and try to understand these two very well commented files,
292so that you'll encounter less problems later.
293
294Also be sure to double check that commands that query printers
295for their internal page counter work from the command line
296before using them in PyKota's configuration.
297
298The rest of the installation depends on your printing system :
299
300  - CUPS Printing System :
301 
302    Once and for all :
303   
304        Create a symbolic link to the cupspykota backend
305        in CUPS's backend directory :
306       
307          $ cd /usr/lib/cups/backend
308          $ ln -s /usr/bin/cupspykota cupspykota
309         
310        Restart CUPS so that the new backend can be detected.
311       
312          $ /etc/init.d/cupsys restart
313         
314    For dumb printers :
315   
316        The FAQ contains both the PyKota's definition of a 'dumb'
317        printer, and how to deal with them.
318   
319    For new printers :
320   
321        Go to CUPS management interface (http://localhost:631)
322        and choose the appropriate PyKota managed device depending
323        on the type of printer you use. For example, if your
324        printer is waiting on :
325       
326            socket://myprinter.domain.com:9100
327           
328        Then choose :   
329       
330            cupspykota:socket://myprinter.domain.com:9100
331           
332        Configure your printer as usual.   
333       
334        Now double check /etc/pykota/pykota.conf
335        This file should contain a section named after the
336        printer you've just added.
337       
338        That's all.
339   
340    For existing printers :
341   
342        If you had already installed a version of PyKota earlier
343        than 1.16alpha7, then remove the *cupsFilter lines in your
344        PPD files for each printer already managed printers. Each
345        line to remove is of the form :
346       
347          *cupsFilter: "application/vnd.cups-postscript 0 /usr/bin/pykota"
348       
349        Don't touch anything else, especially any other *cupsFilter line.
350        Then save each of these files.
351       
352        Then, the easiest is to directly modify the DeviceURI lines
353        in /etc/cups/printers.conf, you just have to put
354        'cupspykota:' in front of what is already on these lines.
355        For example, replace :
356   
357            DeviceURI socket://myprinter.domain.com:9100
358       
359        with :   
360   
361            DeviceURI cupspykota:socket://myprinter.domain.com:9100
362       
363        Save the file and restart CUPS.
364
365  - LPRng Printing System :
366 
367    Modify the /etc/printcap file to add two lines identical to these ones :
368   
369    :achk=true
370    :as=|/usr/bin/pykota
371   
372    For each printer on which you want to use print accounting.
373   
374    And then save the file and restart LPRng :
375   
376        $ /etc/init.d/lprng restart
377       
378Now you can begin to populate the PyKota's database with printers,
379users and groups :
380 
381Add printers and users to the quota system and set their quota values :
382
383    $ edpykota --add -P hp2100 -S 40 -H 50 user1 ... userN
384       
385    launching edpykota without any argument or with the --help
386    command line option will show you all the possibilities.
387   
388    by default, each user is limited by "quota", this means that on
389    each printer he can have a different soft and hard limit.
390    You may want to limit the user by his account balance value,
391    in which case, the print quota is shared between all printers
392    instead of being different. To do this, use the following :
393   
394    $ edpykota --add -P hp2100 --limitby balance --balance 10 user1 ... userN
395   
396    This will put 10 $ (or Euros, PyKota doesn't care) on each user's account
397    balance, and tell PyKota to limit them by their account balance value.
398    Whenever they print on any printer, their account balance value is
399    decreased by an amount which depends on the particular price per page
400    and per job that you may have defined on the printer with edpykota's
401    --charge command line option.
402    Soft and Hard limits are not used if "--limitby balance" is used,
403    but you can define a "poorman"'s threshold in /etc/pykota/pykota.conf
404    to obtain a similar result (warning message when quota is low).
405
406Restart CUPS or LPRng, for example under Debian GNU/Linux systems :         
407
408    $ /etc/init.d/cupsys restart
409   
410  or :
411 
412    $ /etc/init.d/lprng restart
413       
414Your users now should be able to print but not exceed their
415printing quota.
416
417To see printer quota usage, you can use :
418
419    $ repykota --printer lp
420   
421or :
422
423    $ repykota
424   
425    which will print quota usage for all users on all printers,
426    along with totals, if you are the root user. If you are
427    a regular user, only your own quota report will be produced.
428   
429Quota reports are also available remotely by using the CGI script
430printquota.cgi provided in the cgi-bin/ subdirectory.
431
432For different security concerns, please give a look at the SECURITY
433file which is part of this software.
434           
435============================================================
436
437Mailing list :
438--------------
439
440  A mailing list is dedicated to Pykota, you can subscribe to it
441  or consult its archives at :
442 
443    http://cgi.librelogiciel.com/mailman/listinfo/pykota
444   
445IRC :   
446-----
447
448  You can also chat with us :
449 
450        /server irc.freenode.net
451        /join #pykota
452   
453============================================================
454   
455Please e-mail bugs to the mailing list at : pykota@librelogiciel.com
456or to the main author at : alet@librelogiciel.com (Jerome Alet)
Note: See TracBrowser for help on using the browser.