# PyKota sample configuration file # # Copy this file in cups' configuration directory # usually /etc/cups under the name pykota.conf # # PyKota - Print Quotas for CUPS and LPRng # # (c) 2003 Jerome Alet # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # # $Id$ # [global] # Storage backend for quotas # only PostgreSQL is supported # Ldap, MySQL, Berkeley are planned storagebackend: postgresql # Quota Storage Server hostname (and optional port) # e.g. db.mydomain.com:5432 storageserver: localhost # # name of the Quota Storage Database storagename: pykota # Quota Storage administrator's and normal user's names and passwords storageadmin: pykotaadmin storageuser: pykotauser # storageadminpw: Comment out if unused, or set to Quota Storage admin password # storageuserpw: Comment out if unused, or set to Quota Storage user password # Where to log ? # supported values : stderr, system (system means syslog, but don't use 'syslog' here) # if the value is not set then the default SYSTEM applies. logger: system # Mail server to use to warn users # If the value is not set then localhost is used. smtpserver: localhost # What is the accounting backend to use # # supported values : # # - querying : asks the printer for its lifetime page counter # via either SNMP, AppleTalk, or any external # command. This method is the method used by # default in PyKota since its beginning. # # - external : delegates the job's size computation to any # external command of your choice. A stupid and # completely unreliable example, but which # shows what this command may be is : # # accounter: external(/bin/grep -c showpage) # # - stupid : counts the occurences of the 'showpage' postscript # statement in the document to be printed, only at # the beginning of each line which makes the postscript # file. THIS IS NOT RELIABLE. This is just to serve as # an example on how to implement your own accounting # method. # # This value can be set either globally or on a per printer basis # If both are defined, the printer option has priority. # if not set it defaults to 'querying'. accounter: querying # Print Quota administrator # These values can be set either globally or per printer or both. # If both are defined, the printer option has priority. # If these values are not set, the default admin root # and the default adminmail root@localhost are used. admin: Jerome Alet adminmail: alet@librelogiciel.com # # Who should we send an email to in case a quota is reached ? # possible values are : DevNull, User, Admin, Both # The Both value means that the User and the Admin will receive # an email message. # The DevNull value means no email message will be sent. # This value can be set either globally or per printer or both. # If both are defined, the printer option has priority. # If the value is not set, then the default BOTH applies. mailto: both # # Grace delay in days # This value can be set either globally or per printer or both. # If both are defined, the printer option has priority. # If the value is not set then the default seven (7) days applies. gracedelay: 7 # one section per printer, or no other section at all if all options # are defined globally [lp] # How to query the lp printer for its page counter. # THIS IS ONLY USED IF YOU HAVE SET 'accounter' TO 'querying' # JUST COMMENT IT OUT IF YOU USE ANY OTHER ACCOUNTING METHOD. # Only snmp(community, oid) and external(command) are supported # # Example : # requester: external(snmpget -c public -Ov %(printer)s 43.10.2.1.4.1.1 | cut -f 2,2 -d " ") # and : # requester: snmp(public, 43.10.2.1.4.1.1) # are equivalent # # Another untested example, using npadmin : # requester: external(npadmin --pagecount %(printer)s) # # Another example, for AppleTalk printers which works fine : # (You may need the pap CUPS backend installed, and copy the # pagecount.ps file from untested/netatalk into /etc or any # appropriate location) # requester: external(/usr/bin/pap -p "%(printer)s:LaserWriter" /etc/pagecount.ps 2>/dev/null | grep -v status | grep -v Connect | tail -1) # # This value can be set either globally or per printer or both. # If both are defined, the printer option has priority. # # NB : The SNMP oid 43.10.2.1.4.1.1 works on HP Laserjet Printers, but it may # be different with other brands, refer to your printer's documentation # for details. requester: external(snmpget -c public -Ov %(printer)s 43.10.2.1.4.1.1 | cut -f 2,2 -d " ") # Default policy for inexistant users (e.g. root) # either allow or deny # This value can be set either globally or per printer or both. # If both are defined, the printer option has priority. # If the value is not set then the default policy DENY applies. # ATTENTION : # Before 1.04 the default value was ALLOW, but unknown users # allowed to print causes accuracy problems : their jobs are # charged to the next person who prints on the same printer. policy: deny