root / pykota / trunk / README @ 2345

Revision 2345, 26.7 kB (checked in by jerome, 19 years ago)

Removed the outdated and confusing autoconf/automake stuff.
pkpgcounter is now distributed separately ONLY.
Severity : Installing this version without downloading and installing
pkpgcounter v1.56 or higher first WILL BREAK your PyKota setup.

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