root / pykota / trunk / README @ 2048

Revision 2048, 23.3 kB (checked in by jalet, 19 years ago)

Notes about UI

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