root / pykota / trunk / conf / pykota.conf.sample @ 1087

Revision 1087, 10.2 kB (checked in by jalet, 21 years ago)

Really big modifications wrt new configuration file's location and content.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[695]1# PyKota sample configuration file
2#
[1087]3# Copy this file into the /etc/pykota/ directory
4# under the name /etc/pykota/pykota.conf
[695]5#
[952]6# PyKota - Print Quotas for CUPS and LPRng
[695]7#
8# (c) 2003 Jerome Alet <alet@librelogiciel.com>
[873]9# This program is free software; you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
[695]13#
[873]14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, write to the Free Software
21# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
[695]22#
23# $Id$
24#
25
26[global]
27# Storage backend for quotas
[1047]28# only PGStorage (PostgreSQL) and LDAPStorage (OpenLDAP) are supported.
29# MySQL and BerkeleyDB are planned.
[859]30
[1021]31# the 'postgresql' value is deprecated, use 'pgstorage' instead.
32storagebackend: pgstorage
33
[952]34# Quota Storage Server hostname (and optional port)
[859]35# e.g. db.mydomain.com:5432
[695]36storageserver: localhost
[859]37
38#
39# name of the Quota Storage Database
[695]40storagename: pykota
[859]41
[1087]42#
43# Quota Storage normal user's name and password
44# These two fields contain a username and optional password
45# which may give readonly access to your print quota database.
46#
47# PLEASE ENSURE THAT THIS USER CAN'T WRITE TO YOUR PRINT QUOTA
48# DATABASE, OTHERWISE ANY USER WHO COULD READ THIS CONFIGURATION
49# FILE COULD CHANGE HIS PRINT QUOTA.
50#
51storageuser: pykotauser
52# storageuserpw: Comment out if unused, or set to Quota Storage user password
[695]53
[1021]54# NB : storageuser and storageuserpw are not used anymore
55
[1038]56# LDAP example, uncomment and adapt it to your own configuration :
[1016]57#storagebackend: ldapstorage
58#storageserver: ldap://ldap.librelogiciel.com:389
59#storagename: dc=librelogiciel,dc=com
[1087]60#storageuser: cn=notadmin,dc=librelogiciel,dc=com
61#storageuserpw: abc.123
[1025]62#
63# Here we define some helpers to know where
64# to plug into an existing LDAP directory
[1029]65#userbase: ou=People,dc=librelogiciel,dc=com
[1025]66#userrdn: uid
[1038]67#balancebase: ou=People,dc=librelogiciel,dc=com
68#balancerdn: uid
[1029]69#groupbase: ou=Groups,dc=librelogiciel,dc=com
[1025]70#grouprdn: cn
[1029]71#printerbase: ou=Printers,ou=PyKota,dc=librelogiciel,dc=com
[1025]72#printerrdn: cn
[1029]73#jobbase: ou=Jobs,ou=PyKota,dc=librelogiciel,dc=com
74#userquotabase: ou=UQuotas,ou=PyKota,dc=librelogiciel,dc=com
75#groupquotabase: ou=GQuotas,ou=PyKota,dc=librelogiciel,dc=com
76#lastjobbase: ou=LastJobs,ou=PyKota,dc=librelogiciel,dc=com
77#
78# Choose what attribute contains the list of group members
79# common values are : memberUid, uniqueMember, member
80#groupmembers: memberUid
[1016]81
[695]82# Where to log ?
[707]83# supported values : stderr, system (system means syslog, but don't use 'syslog' here)
[853]84# if the value is not set then the default SYSTEM applies.
[782]85logger: system
[695]86
[1047]87# Enable debugging ? Put YES instead here,
88# but only if something went wrong and you want
89# to learn from where the problem comes from.
90# Actually only database queries are logged.
[1021]91debug : No
92
[695]93# Mail server to use to warn users
[853]94# If the value is not set then localhost is used.
[695]95smtpserver: localhost
[806]96
[974]97# What is the accounting backend to use
98#
99# supported values :
100#
101#    - querying : asks the printer for its lifetime page counter
[976]102#                 via either SNMP, AppleTalk, or any external
103#                 command. This method is the method used by
104#                 default in PyKota since its beginning.
105#
[980]106#    - external : delegates the job's size computation to any
107#                 external command of your choice. A stupid and
108#                 completely unreliable example, but which
109#                 shows what this command may be is :
110#
111#                   accounter: external(/bin/grep -c showpage)
[1000]112#
113#                 Another one, which should work with all DSC
114#                 compliant Postscript files :
115#
116#                   accounter: external(/bin/grep -c "%%Page:")
[980]117#
[976]118#    - stupid : counts the occurences of the 'showpage' postscript
[1001]119#               statement in the document to be printed.
120#               THIS IS NOT RELIABLE. This is just to serve as
[976]121#               an example on how to implement your own accounting
122#               method.
123#
[974]124# This value can be set either globally or on a per printer basis
[976]125# If both are defined, the printer option has priority.
126# if not set it defaults to 'querying'.
[994]127#
128# A script which seems to be accurate, copy it from the
129# untested/postscript directory to another place.
130# accounter: external(/usr/local/bin/pagecount.sh)
[1000]131# WARNING : it may not work when multiple copies are asked.
132#           this breaks ghostscript, I don't know why yet.
[994]133#
134# default value
[974]135accounter: querying
[806]136
137# Print Quota administrator
138# These values can be set either globally or per printer or both.
139# If both are defined, the printer option has priority.
[853]140# If these values are not set, the default admin root
141# and the default adminmail root@localhost are used.
[806]142admin: Jerome Alet
143adminmail: alet@librelogiciel.com
144
[695]145#
[852]146# Who should we send an email to in case a quota is reached ?
147# possible values are : DevNull, User, Admin, Both
148# The Both value means that the User and the Admin will receive
149# an email message.
150# The DevNull value means no email message will be sent.
151# This value can be set either globally or per printer or both.
152# If both are defined, the printer option has priority.
[853]153# If the value is not set, then the default BOTH applies.
[852]154mailto: both
155
156#
[695]157# Grace delay in days
[806]158# This value can be set either globally or per printer or both.
159# If both are defined, the printer option has priority.
[853]160# If the value is not set then the default seven (7) days applies.
[695]161gracedelay: 7
162
[1077]163#
164# Poor man's threshold
165# If account balance reaches below this amount,
166# a warning message is sent by email
167#
168# If unset, default poor man's threshold is 1.0.
169# This option can only appear in the global section
170poorman: 2.0
171
172# Poor man's warning message
173# The warning message that is sent if the "poorman" value is reached
174# Again this must appear in the global section
175poorwarn: Your Print Quota account balance is low.
176 Soon you'll not be allowed to print anymore.
177
178# Soft limit reached warning message
179# The warning message that is sent if the soft quota limit is reached
180# May appear either globally or on a per-printer basis
181softwarn: Your Print Quota Soft Limit is reached.
182 This means that you may still be allowed to print for some
183 time, but you must contact your administrator to purchase
184 more print quota.
185 
186# Hard limit reached error message
187# The error message that is sent if the hard quota limit is reached
188# May appear either globally or on a per-printer basis
189hardwarn: Your Print Quota Hard Limit is reached.
190 This means that you are not allowed to print anymore.
191 Please contact your administrator at root@localhost
192 as soon as possible to solve the problem.
193
[853]194# one section per printer, or no other section at all if all options
[1025]195# are defined globally.
[1047]196# Each section's name must be the same as the printer's queue name as defined
[1025]197# in your printing system, be it CUPS or LPRng.
[1027]198# If you don't want any special printer section, just comment out
199# the line below so that following options are global.
[1025]200[hpmarketing]
[806]201
[1047]202# How to query the hpmarketing printer for its page counter.
[980]203# THIS IS ONLY USED IF YOU HAVE SET 'accounter' TO 'querying'
204# JUST COMMENT IT OUT IF YOU USE ANY OTHER ACCOUNTING METHOD.
[1002]205# (it would be ignored anyway)
206#
[1047]207# In the lines below "%(printer)s" is automatically replaced
208# at run time with your printer's Fully Qualified Domain Name
209# e.g. myprinter.domain.com
210#
[780]211# Only snmp(community, oid) and external(command) are supported
[903]212#
213# Example :
[1025]214#     requester: external(/usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ")
[780]215# and :
[998]216#     requester: snmp(public, mib-2.43.10.2.1.4.1.1)
[794]217# are equivalent
[903]218#
219# Another untested example, using npadmin :
[1025]220#     requester: external(/usr/bin/npadmin --pagecount %(printer)s)
[903]221#
[919]222# Another example, for AppleTalk printers which works fine :
[952]223# (You may need the pap CUPS backend installed, and copy the
224# pagecount.ps file from untested/netatalk into /etc or any
225# appropriate location)
[964]226#     requester: external(/usr/bin/pap -p "%(printer)s:LaserWriter" /etc/pagecount.ps  2>/dev/null | grep -v status | grep -v Connect | tail -1)
[919]227#
[806]228# This value can be set either globally or per printer or both.
229# If both are defined, the printer option has priority.
[830]230#
[998]231# NB : The SNMP oid mib-2.43.10.2.1.4.1.1 works on HP Laserjet Printers, but it may
[830]232#      be different with other brands, refer to your printer's documentation
[999]233#      for details. Also you may have to specify -v2c or -v3 depending on your
234#      printer's support for different versions of the SNMP specification.
[1002]235#
[1055]236#
237# Some examples and comments provided by Bob Martel from csuohio.edu
238#
239# For several printers I could not get the page count using snmpget.  I
240# resorted to snmpwalk:
241#
242# requester: external(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public %(printer)s | grep mib-2.43.10.2.1.4.1.1 | cut -d " " -f4)
243#
244# The last example is still more ugly, some of the printers only provided
245# their counters without names, but at least always on the same line:
246#
247# requester: external(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public -Ov %(printer)s | grep Counter32 | tail -2 | head -1 | cut -d " " -f2)
248#
249#
[1002]250# WARNING : In any case, when using an external requester, please test the command line outside
251#           of PyKota before. This will save you some headaches in case it doesn't work as expected.
[1025]252requester: external(/usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ")
[806]253
[695]254# Default policy for inexistant users (e.g. root)
[713]255# either allow or deny
[806]256# This value can be set either globally or per printer or both.
257# If both are defined, the printer option has priority.
[956]258# If the value is not set then the default policy DENY applies.
259# ATTENTION :
[960]260#     Before 1.04 the default value was ALLOW, but unknown users
[956]261#     allowed to print causes accuracy problems : their jobs are
262#     charged to the next person who prints on the same printer.
[1038]263# There's no policy wrt inexistant groups, they are ignored.
[956]264policy: deny
Note: See TracBrowser for help on using the browser.