root / pykota / trunk / README @ 1159

Revision 1159, 14.0 kB (checked in by jalet, 21 years ago)

More buzz !

  • 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          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       
58        - Can ask printers for their internal page counter
59          via SNMP, Netatalk, or any other mean of your
60          choice. This is completely configurable.
61         
62        - External accounting methods are configurable 
63           
64    Quota systems :       
65   
66        - Supports user and groups quotas.
67       
68        - Supports page quotas.
69          Page quotas can be set differently on a per printer
70          and per user/group basis.
71       
72        - Supports account balance quotas in any currency.
73          Account balance quotas can be set on a per user
74          basis. The account balance is shared amongst
75          all printers.
76         
77        - Experimental support for printer groups, so that
78          you can share quota between printers of the same
79          type but in different locations.
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) for its total pages counter, just before the beginning
161    of a job, and use this to modify the *preceding* user's quota. So
162    you're always late of one print job, but this is generally ok,
163    especially because a check is also done to see if the current user
164    is allowed or not to print. You're not limited to SNMP or Netatalk,
165    because you can also use any external command instead if you want.
166   
167  - The 'external' method consists in delegating the computation of the
168    job's size in number of pages to any external command of your choice.
169    The command can read the job's data from its standard input and MUST
170    output the job's size on its standard output.
171   
172  - The 'stupid' method consists in counting the 'showpage' PostSript 
173    statements in the job. THIS IS UNRELIABLE, but can serve as an
174    example if you plan to write your own accounting method for
175    integration into PyKota.
176 
177PyKota is known to work fine with HP Laserjet 2100 and 2200, and
178Apple LaserWriter 16/600 PS, both with CUPS and LPRng, under
179Debian GNU/Linux (Sarge and Sid) operating systems.
180
181I'm interested in receiving success or failure reports with other
182brands or models of printers, as well as with other operating
183systems.
184
185============================================================
186
187INSTALLATION:
188=============
189
190WARNING :
191=========
192
193  If you run a PyKota version lower than 1.03, you definitely have to
194  upgrade you Quota Storage Database. Please read the documentation
195  included in the initscripts subdirectory first !
196 
197  Users of MacOS-X may find the following tutorial useful :
198
199      http://ell-tech.com/pages/pykota.php
200
201Prerequisite :
202--------------
203   
204  You need to have the following tools installed on the CUPS Server :
205 
206    - CUPS or LPRng
207    - Python v2.1 or above
208    - eGenix' mxDateTime Python extension
209    - SNMP tools (specifically the snmpget command) if you plan to
210      request your printer's lifetime page counter via SNMP.
211    - Netatalk (specifically the pap command) if you plan to
212      request your printer's lifetime page counter via AppleTalk.
213    - PostgreSQL's PygreSQL Python extension and the PostgreSQL client
214      libraries if you plan to use PostgreSQL as the Quota Storage
215      backend.
216 or     
217    - python-ldap Python module and the OpenLDAP client libraries 
218      if you plan to use OpenLDAP as the Quota Storage backend.
219   
220  You need to have the following tools installed on the Quota Storage 
221  Server :
222 
223    - PostgreSQL
224   
225  or 
226 
227    - OpenLDAP
228   
229NB :   
230
231  PygreSQL must be linked with the PostgreSQL client libraries on
232  the Print Server. The PostgreSQL client libraries' version must
233  match the PostgreSQL version used on the Quota Storage Server.
234 
235or 
236
237  python-ldap must be linked with the OpenLDAP client libraries on the
238  Print Server. The OpenLDAP client libraries' version must match the
239  OpenLDAP version used on the Quota Storage Server.
240 
241  This list of prerequisite software may change in the future, when
242  PyKota will support more functionnalities you will be given
243  alternatives.
244 
245  Of course the Print Server and the Quota Storage Server can be the
246  very same machine if you've got a tiny network, or you can have
247  multiple Print Servers all storing their quotas on the same Quota
248  Storage Server if you've got a bigger network.
249 
250Then :   
251------
252 
253Download the latest PyKota version from the CVS tree on :
254
255    http://savannah.nongnu.org/projects/pykota
256
257Just type :
258
259    python setup.py install
260
261You may need to be logged in with sufficient privileges (e.g. root)
262
263The installation script will now automatically check if some software
264is missing and ask you if you still want to proceed with the
265installation or abort it completely.
266
267Go to the initscripts subdirectory of PyKota's sources, and choose
268the appropriate storage backend for your configuration. Read
269the associated README file and execute the initialization script
270to create an empty PyKota Storage. Upgrade scripts may be
271provided as well.
272
273Copy the conf/pykota.conf.sample and  conf/pykotadmin.conf.sample
274sample configuration files to /etc/pykota/pykota.conf and
275/etc/pykota/pykotadmin.conf. The installation script tries to do this
276for you if needed and you agreed to this action.
277You need to adapt these files to your own needs.
278Especially you have to create sections named after your own
279printers, and change the administrator's email address.
280
281  - CUPS Print Backend :
282 
283    Modify the PPD files for each printer on which you want to manage
284    print quotas, for example /etc/cups/ppd/lp.ppd :
285   
286    --- Add the line below exactly as-is somewhere near the top ---
287    *cupsFilter:  "application/vnd.cups-postscript 0 /usr/bin/pykota"
288    --- Add the line above exactly as-is somewhere near the top  ---
289   
290    Modify the path to the pykota executable if needed, unfortunately
291    you have to supply the correct absolute path here due to CUPS
292    internals, or put the pykota executable into /usr/lib/cups/filter
293    instead of into /usr/bin.
294   
295    Do this for each ppd file present in this directory if you want
296    to enable quota on every printer.
297             
298    WARNING : In the case you've got a non-postscript printer, chances
299              are that the *cupsFilter is already filled-in and points
300              to cupsomatic or such a print filter. In this case please
301              check if you can switch your printer to PostScript mode
302              or if there's a way to make it accept PostScript jobs.
303              If yes then ensure that your workstations uses a PostScript
304              printer driver, and replace the *cupsFilter line with the
305              one pointing to the pykota filter. This should work, but
306              is currently untested.
307              If your printer really needs the original *cupsFilter line
308              then you may not be able to use PyKota easily for now.
309
310  - LPRng Print Backend :
311 
312    Modify the /etc/printcap file to add two lines identical to these ones :
313   
314    :achk=true
315    :as=|/usr/bin/pykota
316   
317    For each printer on which you want to use print accounting.
318 
319Add printers and users to the quota system and set their quota values :
320
321    $ edpykota --add -P hp2100 -S 40 -H 50 user1 ... userN
322       
323    launching edpykota without any argument or with the --help
324    command line option will show you all the possibilities.
325   
326    by default, each user is limited by "quota", this means that on
327    each printer he can have a different soft and hard limit.
328    You may want to limit the user by his account balance value,
329    in which case, the print quota is shared between all printers
330    instead of being different. To do this, use the following :
331   
332    $ edpykota --add -P hp2100 --limitby balance --balance 10 user1 ... userN
333   
334    This will put 10 $ (or Euros, PyKota doesn't care) on each user's account
335    balance, and tell PyKota to limit them by their account balance value.
336    Whenever they print on any printer, their account balance value is
337    decreased by an amount which depends on the particular price per page
338    and per job that you may have defined on the printer with edpykota's
339    --charge command line option.
340    Soft and Hard limits are not used if "--limitby balance" is used,
341    but you can define a "poorman"'s threshold in /etc/pykota/pykota.conf
342    to obtain a similar result (warning message when quota is low).
343
344Restart CUPS or LPRng, for example under Debian GNU/Linux systems :         
345
346    $ /etc/init.d/cupsys restart
347   
348  or :
349 
350    $ /etc/init.d/lprng restart
351       
352Your users now should be able to print but not exceed their
353printing quota.
354
355To see printer quota usage, you can use :
356
357    $ repykota --printer lp
358   
359or :
360
361    $ repykota
362   
363    which will print quota usage for all users on all printers,
364    along with totals, if you are the root user. If you are
365    a regular user, only your own quota report will be produced.
366   
367Quota reports are also available remotely by using the CGI script
368printquota.cgi provided in the cgi-bin/ subdirectory.
369
370For different security concerns, please give a look at the SECURITY
371file which is part of this software.
372           
373============================================================
374
375Mailing list :
376--------------
377
378  A mailing list is dedicated to Pykota, you can subscribe to it
379  or consult its archives at :
380 
381    http://cgi.librelogiciel.com/mailman/listinfo/pykota
382   
383============================================================
384   
385Please e-mail bugs to the mailing list at : pykota@librelogiciel.com
386or to the main author at : alet@librelogiciel.com (Jerome Alet)
Note: See TracBrowser for help on using the browser.