root / pykota / trunk / README @ 2114

Revision 2067, 24.5 kB (checked in by jalet, 20 years ago)

Updated the list of features

  • 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    Free Software :
30   
31        - Licensed under the terms of the GNU General Public License.
32       
33    Commercially Supported :   
34   
35        - Support Contracts are available from http://www.librelogiciel.com/techsupport/
36       
37    Operating systems :
38   
39        - Any Unix-like system as print server.
40           
41        - Any operating system as client.
42           
43    Printing systems :
44   
45        - Supports both CUPS and LPRng as the printing system.
46       
47    Databases :
48   
49        - Supports PostgreSQL as the Quota Storage backend.
50          Complete database creation script in SQL is included.
51       
52        - Supports any LDAP server as the Quota Storage backend.
53          Complete LDAP schema and sample empty tree are included.
54          Plugging PyKota into your existing LDAP infrastructure
55          is really easy thanks to PyKota's great configurability.
56         
57        - The print jobs history can be stored in any database 
58          of your choice (or in plain text files) if needed.
59           
60    Printers :       
61   
62        - Hardware or Software accounting methods are completely
63          configurable.
64         
65        - Supports any printer which can report its internal
66          page counter. Can ask printers for their internal
67          page counter via SNMP, Netatalk, PJL, PS, or any
68          other way.
69          This is completely configurable.
70         
71        - Supports DSC compliant and binary PostScript, PDF, PCL5 (up to),
72          PCLXL (aka PCL6) and ESC/P2 printers natively for software
73          accounting methods. More formats to come.
74           
75    Quota systems :       
76   
77        - Supports printers and printers groups quotas.
78       
79        - Supports users and users groups quotas.
80       
81        - Supports page quotas.
82          Page quotas can be set differently on a per printer
83          and per user/group basis.
84       
85        - Supports account balance quotas in any currency.
86          Account balance quotas can be set on a per user
87          basis. The account balance is shared amongst
88          all printers. The history of payments (positive
89          or negative credits to an user account) is kept.
90         
91        - Page quotas and account balance can be set/reset
92          independantly.
93         
94        - Page quotas can be set on a per user or per group basis
95          for a particular printer.
96         
97        - Price per page and per job can be set differently 
98          on any printer.
99       
100        - Low level of page quota or account balance are
101          configurable.
102         
103        - Both soft and hard limit with configurable grace delay 
104          can be set for page quota.
105         
106        - Possibility to disable quota enforcement for any user
107          or group, while still keeping page accounting.
108         
109        - Each user can have an overcharging (or undercharging) factor, 
110          which is applied whenever PyKota computes the cost of a
111          print job.
112         
113    Administration :       
114   
115        - Powerful delegation of administrative priviledges.
116       
117        - Powerful administration tools can be used to
118          automate setting or resetting of quotas or
119          account balances at specific intervals.
120         
121        - Administration tools can modify several users, 
122          groups, or printers at once with the use of
123          powerful wildcard characters.
124         
125        - Account balances can be set, incremented, or 
126          decremented. History of payments is kept.
127         
128        - Number of pages used can be set, incremented, or 
129          decremented.
130         
131        - Both printers and users can be automatically added on
132          first print in a completely configurable way.
133         
134        - Quota report generator available either from the 
135          command line or in any web browser.
136          The web-based quota report generator can be
137          user/password protected.
138         
139        - Print quote generator can tell users how much 
140          a print job will cost them in advance.
141         
142        - Policy with regard to unregistered users can   
143          be configured for each printer to either deny
144          printing, allow printing, or delegate the
145          decision to any external tool.
146         
147        - Warning and error messages can be automatically 
148          sent via email or via any other mean to the administrator,
149          the user, both, or none.
150         
151        - Warning and error messages' content is completely
152          configurable.
153         
154        - Configuration can be changed without needing to 
155          restart the printing system.
156       
157        - Complete print job history is kept. This can be
158          disabled if needed.
159         
160        - Automated low quota or balance remainder can be
161          scheduled regularly or launched manually.
162         
163        - Starting and Ending personalized dynamic banners can be
164          generated on the fly, and accounted for or not, depending
165          on some configuration settings.
166          Banners can still be enabled even if the print job is denied.
167          NB : Banners are a CUPS only feature for now.
168         
169        - Duplicate print jobs can be forbidden automatically. 
170         
171        - Powerful data dumper to export datas to other
172          software (spreadsheets for example). Actually
173          supported formats are :
174         
175            - Comma separated values ;
176           
177            - Semicolon separated values ;
178           
179            - Tab separated values ;
180           
181            - XML.
182           
183            - CUPS' page_log format, to easily interface in
184              real time with third party apps like phpPrintAnalyzer
185              and similar tools.
186         
187    User Interface :         
188   
189        - All the command line tools accept the -h | --help
190          command line option which prints all the available
191          options and show usage examples.
192         
193        - Completely internationalized. Actually supports the 
194          English, French, Spanish, Portuguese, Brasilian, Swedish,
195          Thai, Greek, German, Italian, Norwegian (Bokm�, Turkish
196          and traditional Chinese languages.
197          More to come.
198         
199        - Web based print quota monitor and data dumper are included. 
200       
201        - An On Screen Display X-Window print quota monitor is included.
202       
203        - An email gateway to allow users to retrieve their print quota
204          information by sending an email message to a dedicated address
205          is included.
206       
207        - A cross-platform print quota monitor will soon be available
208          as an purchaseable add-on.
209         
210        - Third party web based management tools are available.
211
212====================================================================
213       
214Planned features are described in the TODO file.
215
216Actually two (or an infinity of) page accounting methods are
217implemented :
218
219  - The 'hardware' method consists in querying the printer (via SNMP
220    or Netatalk or any other method of your choice) for its total pages
221    counter.
222   
223    This is done both at the beginning and at the end of a
224    print job. The counters difference is then immediately used to
225    decrease the user's account balance or increase his quota usage.
226   
227  - The 'software' method consists in delegating the computation of the
228    job's size in number of pages to any external command of your choice.
229    The command can read the job's data from its standard input and MUST
230    output the job's size on its standard output. Changes to the user
231    account are reported immediately.
232   
233PyKota is known to work fine with most laser printers, either with
234software accounting, or with hardware accounting if the printer
235supports this.
236
237============================================================
238
239SUPPORT CONTRACTS:
240==================
241
242  You can now purchase 8x5x365@NextBusinessDay Technical
243Support Contracts from us. The yearly fee is computed with 
244the following formula :
245
246  (100.0 * NbPrintServers) + (2.5 * NbPrinters) + (0.04 * NbUsers) EUROS.
247 
248  This fee includes the VAT, and a free subscription to official 
249PyKota packages. 
250
251  Please send an email to alet@librelogiciel.com if you're
252interested in purchasing such a contract.   
253
254============================================================
255
256INSTALLATION:
257=============
258
259NB :
260====
261
262  You may learn more about PyKota, if it fits your own organization,
263  its internal working, and some potential performance drawbacks and
264  how to avoid them, in a document created by Ryan Suarez at :
265 
266    http://archive.macosxlabs.org/forum/webcrossing_archive/documentation/Pykota_and_CUPS/Pykota_and_CUPS.html
267
268  You may also find the following document interesting :
269 
270    http://es.tldp.org/Tutoriales/doc-openldap-samba-cups-python/
271   
272  This document, written in Spanish by Sergio Gonzalez Gonzalez, 
273  describes the integration of PyKota into an OpenLDAP + Samba
274  + CUPS installation. Even for people who can't read spanish
275  this document is really interesting, and contains lots of
276  screenshots.
277 
278  Finally, SuSe users may find the following document to best describe
279  how to install PyKota on their favorite distribution. It's a Spanish
280  document written by Dennis Romero :
281 
282    http://www.cvr.espol.edu.ec/people/dennis/Pykota1.19-SuSE9.1.pdf
283 
284 
285Prerequisite :
286--------------
287   
288  You need to have the following tools installed on the CUPS Server :
289 
290    - CUPS (http://www.cups.org) or LPRng (http://www.lprng.com)
291    - Python v2.1 or above (http://www.python.org)
292    - eGenix' mxDateTime Python extension (http://www.egenix.com)
293    - The JAXML Python module to be able to dump datas in the XML format.
294      (http://www.librelogiciel.com/software/)
295    - The Python-SNMP module to query printers for their page counter.
296      (http://pysnmp.sourceforge.net).
297      IMPORTANT : version 3.4.3 (or 3.4.2) is REQUIRED. Versions 2.x or
298      4.x won't work for now.
299    - The Python-OSD module to use the graphical print quota reminder.
300    - SNMP tools (specifically the snmpget command) if you prefer to
301      use your own script to request query printers.
302    - Netatalk (specifically the pap command) if you plan to
303      request your printer's lifetime page counter via AppleTalk.
304      (http://netatalk.sourceforge.net)
305    - The ReportLab Python module (http://www.reportlab.org) if you want 
306      to have PyKota generate nice banners for you.
307    - The Python Imaging Library (aka PIL) module
308      (http://www.pythonware.com/downloads) if you want to have PyKota
309      generate nice banners for you.
310    - PostgreSQL's PygreSQL Python extension and the PostgreSQL client
311      libraries if you plan to use PostgreSQL as the Quota Storage
312      backend.
313      (http://www.postgresql.org and http://www.pygreql.org)
314 or     
315    - python-ldap Python module and the OpenLDAP client libraries 
316      if you plan to use an LDAP server as the Quota Storage backend.
317      (http://www.openldap.org and http://python-ldap.sourceforge.net)
318   
319  On Intel i386 architecture, and for performance reasons, it is
320  strongly suggested that you install the Python accelerator Psyco,
321  available at :
322 
323      http://psyco.sourceforge.net
324     
325  Under Debian :   
326 
327      $ apt-get install python-psyco
328     
329  Other architectures may be supported as well in the future, check   
330  this on Psyco's website.
331 
332  Installing Psyco is not mandatory, but it will speedup PCL5 parsing
333  by almost 3 times. PostScript and PDF parsing can also benefit,
334  but in an almost unnoticeable manner since this part of the code
335  is already optimal. For PCL5 this is a completely different matter,
336  and if you install Psyco you will never regret it !
337  Same remark applies for PCL6 (aka PCLXL) : the parser is completely
338  different, but the performance gain with Psyco is impressive.
339 
340  You may also benefit from having the following tools installed to
341  deal with some printers :
342 
343    - npadmin
344    - netcat
345    - ghostscript
346   
347  You need to have the following tools installed on the Quota Storage 
348  Server :
349 
350    - PostgreSQL (http://www.postgresql.org)
351   
352  or 
353 
354    - OpenLDAP, or any other LDAP server (http://www.openldap.org)
355   
356NB :   
357
358  PygreSQL must be linked with the PostgreSQL client libraries on
359  the Print Server. The PostgreSQL client libraries' version must
360  match the PostgreSQL version used on the Quota Storage Server.
361 
362or 
363
364  python-ldap must be linked with the OpenLDAP client libraries on the
365  Print Server. The OpenLDAP client libraries' version should match the
366  OpenLDAP version used on the Quota Storage Server, if applicable.
367 
368  This list of prerequisite software may change in the future, when
369  PyKota will support more functionnalities you will be given
370  alternatives.
371 
372  Of course the Print Server and the Quota Storage Server can be the
373  very same machine if you've got a tiny network, or you can have
374  multiple Print Servers all storing their quotas on the same Quota
375  Storage Server if you've got a bigger network.
376 
377Hint : 
378------
379
380  - The Debian GNU/Linux distribution is to our knowledge the
381    easiest distribution to install PyKota on, because all
382    of PyKota dependencies are already included, excepted
383    for the PySNMP (http://pysnmp.sourceforge.net) module
384    which for now has to be downloaded separately.
385
386Then :   
387------
388 
389Download the latest PyKota version from the CVS tree on :
390
391    http://savannah.nongnu.org/projects/pykota
392
393You can now check if the dependencies are correct by typing :
394
395    python checkdeps.py
396   
397To install the software, just type :
398
399    python setup.py install
400
401You may need to be logged in with sufficient privileges (e.g. root)
402
403Create a system user for PyKota :
404
405    adduser --system --group --home /etc/pykota --gecos PyKota pykota
406   
407Put the user your printing system is run as in the pykota system group :
408
409    adduser lp pykota
410   
411    NB : on our system, the CUPS printing system runs as system user 'lp'.
412    Please adapt this to your own system.
413
414Go to the initscripts subdirectory of PyKota's sources, and choose
415the appropriate storage backend for your configuration. Read carefully
416the associated README file and execute the initialization script
417to create an empty PyKota Storage. Upgrade scripts may be
418provided as well.
419
420Copy the conf/pykota.conf.sample and  conf/pykotadmin.conf.sample
421sample configuration files to /etc/pykota/pykota.conf and
422/etc/pykota/pykotadmin.conf 
423The installation script usually copies these files into /usr/share/pykota
424
425NB : You can move PyKota's configuration files elsewhere, they will
426be searched first in user pykota's home directory.
427
428You need to adapt these files to your own needs. Especially you may
429have to create sections named after your own printers, and change
430the administrator's email address which by default is
431root@localhost. Read and try to understand these two very well
432commented files, so that you'll encounter less problems later.
433
434Also be sure to double check that commands that query printers
435for their internal page counter work from the command line
436before using them in PyKota's configuration.
437
438The rest of the installation depends on your printing system :
439
440  - CUPS Printing System :
441 
442    Once and for all :
443   
444        Create a symbolic link to the cupspykota backend
445        in CUPS's backend directory :
446       
447          $ cd /usr/lib/cups/backend
448          $ ln -s /usr/share/pykota/cupspykota cupspykota
449         
450        Restart CUPS so that the new backend can be detected.
451       
452          $ /etc/init.d/cupsys restart
453         
454        or :   
455     
456          $ /etc/rc.d/init.d/cupsys restart
457         
458        or any similar command depending on your operating system. 
459         
460    For new printers :
461   
462        Go to CUPS management interface (http://localhost:631)
463        and choose the appropriate PyKota managed device depending
464        on the type of printer you use. For example, if your
465        printer is waiting on :
466       
467            socket://myprinter.example.com:9100
468           
469        Then choose :   
470       
471            cupspykota:socket://myprinter.example.com:9100
472           
473        Configure your printer as usual.   
474       
475        Now double check /etc/pykota/pykota.conf
476       
477        You should manually create a section named after the
478        printer you've just added, unless you have set
479        all options globally.
480       
481        The new pkhint command can help you with correct settings
482        for your printers, but don't rely on it because it is still
483        experimental work. To use pkhint, you have to feed it with
484        CUPS' printers.conf file this way :
485       
486          $ pkhint </etc/cups/printers.conf
487       
488        pkhint will try to tell you what is the best accounting
489        method for each printer and will print some lines you'll
490        just have to copy&paste in the appropriate sections in
491        /etc/pykota/pykota.conf
492       
493        That's all.
494   
495    For existing printers :
496   
497        If you had already installed a version of PyKota earlier
498        than 1.16alpha7, then remove the *cupsFilter lines in your
499        PPD files for each already managed printer. Each
500        line to remove is of the form :
501       
502          *cupsFilter: "application/vnd.cups-postscript 0 /usr/share/pykota/pykota"
503       
504        This means that each time the pstops filter will be executed, it will
505        pass the job's data through the pykota filter which is present in
506        /usr/share/pykota
507       
508        Don't touch anything else, especially any other *cupsFilter line.
509        Then save each of these files.
510       
511        Then, the easiest is to directly modify the DeviceURI lines
512        in /etc/cups/printers.conf, you just have to put
513        'cupspykota:' in front of what is already on these lines.
514        For example, replace :
515   
516            DeviceURI socket://myprinter.example.com:9100
517       
518        with :   
519   
520            DeviceURI cupspykota:socket://myprinter.example.com:9100
521           
522        or :   
523       
524            DeviceURI cupspykota://socket://myprinter.example.com:9100
525       
526        Save the file and restart CUPS.
527       
528        Here too, you may find it interesting to use the pkhint command as
529        described above to help with manual configuration of the file
530        /etc/pykota/pykota.conf
531
532  - LPRng Printing System :
533 
534    For each printer on which you want to use PyKota :
535   
536        Modify the printer's entry in /etc/printcap : you have to add
537        the three following lines :
538       
539          :achk=true:\
540          :as=/usr/share/pykota/lprngpykota:\
541          :ae=/usr/share/pykota/lprngpykota:\
542         
543        This will tell LPRng to activate accounting, and use the lprngpykota
544        accounting filter both at the start and at the end of printing.
545       
546    When all modifications are done, just save the /etc/printcap file and   
547    restart LPRng :
548   
549          $ /etc/init.d/lprng restart
550         
551        or :   
552     
553          $ /etc/rc.d/init.d/lprng restart
554         
555        or any similar command depending on your operating system. 
556       
557    NB : the pkhint command can't be used with LPRng for now, so you   
558         have to modify /etc/pykota/pykota.conf carefully. The comments
559         in this file will help you.
560     
561Now you can begin to populate the PyKota's database with printers,
562users and groups :
563 
564Add printers and users to the quota system and set their quota values :
565
566Starting from version 1.18alpha2, the preferred command to manage
567printers is named pkprinters
568
569    $ pkprinters --help
570   
571    will tell you how to create, manage or delete printers and
572    printers groups.
573   
574    $ pkprinters --add --charge 0.05 hp2100
575   
576    would add the printer named hp2100 with a price per page
577    of 0.05 unit.
578
579Now set quotas for users on this printer :     
580
581    $ edpykota --add -P hp2100 -S 40 -H 50 user1 ... userN
582       
583    launching edpykota without any argument or with the --help
584    command line option will show you all the possibilities.
585   
586    by default, each user is limited by "quota", this means that on
587    each printer he can have a different soft and hard limit.
588    You may want to limit the user by his account balance value,
589    in which case, the print quota is shared between all printers
590    instead of being different. To do this, use the following :
591   
592    $ edpykota --add -P hp2100 --limitby balance --balance 10 user1 ... userN
593   
594    This will put 10 $ (or Euros, PyKota doesn't care) on each user's account
595    balance, and tell PyKota to limit them by their account balance value.
596    Whenever they print on any printer, their account balance value is
597    decreased by an amount which depends on the particular price per page
598    and per job that you may have defined on the printer with edpykota's
599    --charge command line option.
600    Soft and Hard limits are not used if "--limitby balance" is used,
601    but you can define a "poorman"'s threshold in /etc/pykota/pykota.conf
602    to obtain a similar result (warning message when quota is low).
603
604Restart CUPS or LPRng, for example under Debian GNU/Linux systems :         
605
606    $ /etc/init.d/cupsys restart
607   
608  or :
609 
610    $ /etc/init.d/lprng restart
611       
612Your users now should be able to print but not exceed their
613printing quota.
614
615To see printer quota usage, you can use :
616
617    $ repykota --printer lp
618   
619or :
620
621    $ repykota
622   
623    which will print quota usage for all users on all printers,
624    along with totals, if you are a PyKota Administator. If you are
625    a regular user, only your own quota report will be produced.
626   
627Quota reports are also available remotely by using the CGI script
628printquota.cgi provided in the cgi-bin/ subdirectory. You can
629also use the CSS stylesheet present in the stylesheets/ subdirectory
630and put it at your web server's DocumentRoot, to benefit from a nicer
631look, especially quota violations will appear in different colors.
632
633For different security concerns, please give a look at the SECURITY
634file which is part of this software.
635           
636============================================================
637
638Additionnal tools :
639-------------------
640
641Some people have developped tools around PyKota, and make
642them available under the GNU General Public License :
643
644  - Kanakorn Horsiritham developped phpPykotaAdmin which is
645    a web based database independant administrative GUI :
646 
647      http://opensource.psu.ac.th/~kanakorn/mambo/
648 
649Additionnal software will be listed here when they will be 
650ready.
651
652============================================================
653
654Mailing list :
655--------------
656
657  A mailing list is dedicated to Pykota, you can subscribe to it
658  or consult its archives at :
659 
660    http://cgi.librelogiciel.com/mailman/listinfo/pykota
661   
662  The mailing list is the preferred way to obtain support, because 
663  all members can help and can also benefit from the solutions
664  proposed by other members.
665 
666  Posts by non-members are usually rejected.
667 
668  The mailing list language is english and only english.
669   
670IRC :   
671-----
672
673  You can also chat with us :
674 
675        /server irc.freenode.net
676        /join #pykota
677       
678  Preferred language on this channel is english, but french     
679  is also accepted. Try to avoid exposing complex problems
680  in french because english speaking people on the channel
681  wouldn't benefit from the solutions.
682 
683  PyKota's main author is known as 'tamere' on IRC.
684   
685============================================================
686   
687Please e-mail bugs to the mailing list at : pykota@librelogiciel.com
688or to the main author at : alet@librelogiciel.com (Jerome Alet)
Note: See TracBrowser for help on using the browser.