[695] | 1 | # PyKota sample configuration file |
---|
| 2 | # |
---|
| 3 | # Copy this file in cups' configuration directory |
---|
| 4 | # usually /etc/cups under the name pykota.conf |
---|
| 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 |
---|
[1021] | 28 | # only PGStorage (PostgreSQL) is supported |
---|
[695] | 29 | # Ldap, MySQL, Berkeley are planned |
---|
[859] | 30 | |
---|
[1021] | 31 | # the 'postgresql' value is deprecated, use 'pgstorage' instead. |
---|
| 32 | storagebackend: pgstorage |
---|
| 33 | |
---|
[952] | 34 | # Quota Storage Server hostname (and optional port) |
---|
[859] | 35 | # e.g. db.mydomain.com:5432 |
---|
[695] | 36 | storageserver: localhost |
---|
[859] | 37 | |
---|
| 38 | # |
---|
| 39 | # name of the Quota Storage Database |
---|
[695] | 40 | storagename: pykota |
---|
[859] | 41 | |
---|
| 42 | # Quota Storage administrator's and normal user's names and passwords |
---|
[695] | 43 | storageadmin: pykotaadmin |
---|
[806] | 44 | # storageadminpw: Comment out if unused, or set to Quota Storage admin password |
---|
[695] | 45 | |
---|
[1021] | 46 | # NB : storageuser and storageuserpw are not used anymore |
---|
| 47 | |
---|
[1016] | 48 | # LDAP example : |
---|
| 49 | #storagebackend: ldapstorage |
---|
| 50 | #storageserver: ldap://ldap.librelogiciel.com:389 |
---|
| 51 | #storagename: dc=librelogiciel,dc=com |
---|
| 52 | #storageadmin: cn=admin,dc=librelogiciel,dc=com |
---|
| 53 | #storageuser: cn=admin,dc=librelogiciel,dc=com |
---|
| 54 | #storageadminpw: abc.123 |
---|
| 55 | #storageuserpw: xyz.345 |
---|
| 56 | |
---|
[695] | 57 | # Where to log ? |
---|
[707] | 58 | # supported values : stderr, system (system means syslog, but don't use 'syslog' here) |
---|
[853] | 59 | # if the value is not set then the default SYSTEM applies. |
---|
[782] | 60 | logger: system |
---|
[695] | 61 | |
---|
[1021] | 62 | # Enable debugging ? Put YES instead here. |
---|
| 63 | debug : No |
---|
| 64 | |
---|
[695] | 65 | # Mail server to use to warn users |
---|
[853] | 66 | # If the value is not set then localhost is used. |
---|
[695] | 67 | smtpserver: localhost |
---|
[806] | 68 | |
---|
[974] | 69 | # What is the accounting backend to use |
---|
| 70 | # |
---|
| 71 | # supported values : |
---|
| 72 | # |
---|
| 73 | # - querying : asks the printer for its lifetime page counter |
---|
[976] | 74 | # via either SNMP, AppleTalk, or any external |
---|
| 75 | # command. This method is the method used by |
---|
| 76 | # default in PyKota since its beginning. |
---|
| 77 | # |
---|
[980] | 78 | # - external : delegates the job's size computation to any |
---|
| 79 | # external command of your choice. A stupid and |
---|
| 80 | # completely unreliable example, but which |
---|
| 81 | # shows what this command may be is : |
---|
| 82 | # |
---|
| 83 | # accounter: external(/bin/grep -c showpage) |
---|
[1000] | 84 | # |
---|
| 85 | # Another one, which should work with all DSC |
---|
| 86 | # compliant Postscript files : |
---|
| 87 | # |
---|
| 88 | # accounter: external(/bin/grep -c "%%Page:") |
---|
[980] | 89 | # |
---|
[976] | 90 | # - stupid : counts the occurences of the 'showpage' postscript |
---|
[1001] | 91 | # statement in the document to be printed. |
---|
| 92 | # THIS IS NOT RELIABLE. This is just to serve as |
---|
[976] | 93 | # an example on how to implement your own accounting |
---|
| 94 | # method. |
---|
| 95 | # |
---|
[974] | 96 | # This value can be set either globally or on a per printer basis |
---|
[976] | 97 | # If both are defined, the printer option has priority. |
---|
| 98 | # if not set it defaults to 'querying'. |
---|
[994] | 99 | # |
---|
| 100 | # A script which seems to be accurate, copy it from the |
---|
| 101 | # untested/postscript directory to another place. |
---|
| 102 | # accounter: external(/usr/local/bin/pagecount.sh) |
---|
[1000] | 103 | # WARNING : it may not work when multiple copies are asked. |
---|
| 104 | # this breaks ghostscript, I don't know why yet. |
---|
[994] | 105 | # |
---|
| 106 | # default value |
---|
[974] | 107 | accounter: querying |
---|
[806] | 108 | |
---|
| 109 | # Print Quota administrator |
---|
| 110 | # These values can be set either globally or per printer or both. |
---|
| 111 | # If both are defined, the printer option has priority. |
---|
[853] | 112 | # If these values are not set, the default admin root |
---|
| 113 | # and the default adminmail root@localhost are used. |
---|
[806] | 114 | admin: Jerome Alet |
---|
| 115 | adminmail: alet@librelogiciel.com |
---|
| 116 | |
---|
[695] | 117 | # |
---|
[852] | 118 | # Who should we send an email to in case a quota is reached ? |
---|
| 119 | # possible values are : DevNull, User, Admin, Both |
---|
| 120 | # The Both value means that the User and the Admin will receive |
---|
| 121 | # an email message. |
---|
| 122 | # The DevNull value means no email message will be sent. |
---|
| 123 | # This value can be set either globally or per printer or both. |
---|
| 124 | # If both are defined, the printer option has priority. |
---|
[853] | 125 | # If the value is not set, then the default BOTH applies. |
---|
[852] | 126 | mailto: both |
---|
| 127 | |
---|
| 128 | # |
---|
[695] | 129 | # Grace delay in days |
---|
[806] | 130 | # This value can be set either globally or per printer or both. |
---|
| 131 | # If both are defined, the printer option has priority. |
---|
[853] | 132 | # If the value is not set then the default seven (7) days applies. |
---|
[695] | 133 | gracedelay: 7 |
---|
| 134 | |
---|
[853] | 135 | # one section per printer, or no other section at all if all options |
---|
| 136 | # are defined globally |
---|
[695] | 137 | [lp] |
---|
[806] | 138 | |
---|
[980] | 139 | # How to query the lp printer for its page counter. |
---|
| 140 | # THIS IS ONLY USED IF YOU HAVE SET 'accounter' TO 'querying' |
---|
| 141 | # JUST COMMENT IT OUT IF YOU USE ANY OTHER ACCOUNTING METHOD. |
---|
[1002] | 142 | # (it would be ignored anyway) |
---|
| 143 | # |
---|
[780] | 144 | # Only snmp(community, oid) and external(command) are supported |
---|
[903] | 145 | # |
---|
| 146 | # Example : |
---|
[999] | 147 | # requester: external(snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") |
---|
[780] | 148 | # and : |
---|
[998] | 149 | # requester: snmp(public, mib-2.43.10.2.1.4.1.1) |
---|
[794] | 150 | # are equivalent |
---|
[903] | 151 | # |
---|
| 152 | # Another untested example, using npadmin : |
---|
| 153 | # requester: external(npadmin --pagecount %(printer)s) |
---|
| 154 | # |
---|
[919] | 155 | # Another example, for AppleTalk printers which works fine : |
---|
[952] | 156 | # (You may need the pap CUPS backend installed, and copy the |
---|
| 157 | # pagecount.ps file from untested/netatalk into /etc or any |
---|
| 158 | # appropriate location) |
---|
[964] | 159 | # requester: external(/usr/bin/pap -p "%(printer)s:LaserWriter" /etc/pagecount.ps 2>/dev/null | grep -v status | grep -v Connect | tail -1) |
---|
[919] | 160 | # |
---|
[806] | 161 | # This value can be set either globally or per printer or both. |
---|
| 162 | # If both are defined, the printer option has priority. |
---|
[830] | 163 | # |
---|
[998] | 164 | # NB : The SNMP oid mib-2.43.10.2.1.4.1.1 works on HP Laserjet Printers, but it may |
---|
[830] | 165 | # be different with other brands, refer to your printer's documentation |
---|
[999] | 166 | # for details. Also you may have to specify -v2c or -v3 depending on your |
---|
| 167 | # printer's support for different versions of the SNMP specification. |
---|
[1002] | 168 | # |
---|
| 169 | # WARNING : In any case, when using an external requester, please test the command line outside |
---|
| 170 | # of PyKota before. This will save you some headaches in case it doesn't work as expected. |
---|
[999] | 171 | requester: external(snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") |
---|
[806] | 172 | |
---|
[695] | 173 | # Default policy for inexistant users (e.g. root) |
---|
[713] | 174 | # either allow or deny |
---|
[806] | 175 | # This value can be set either globally or per printer or both. |
---|
| 176 | # If both are defined, the printer option has priority. |
---|
[956] | 177 | # If the value is not set then the default policy DENY applies. |
---|
| 178 | # ATTENTION : |
---|
[960] | 179 | # Before 1.04 the default value was ALLOW, but unknown users |
---|
[956] | 180 | # allowed to print causes accuracy problems : their jobs are |
---|
| 181 | # charged to the next person who prints on the same printer. |
---|
| 182 | policy: deny |
---|