[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 |
---|
[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. |
---|
| 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 | |
---|
[1038] | 48 | # LDAP example, uncomment and adapt it to your own configuration : |
---|
[1016] | 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 | #storageadminpw: abc.123 |
---|
[1025] | 54 | # |
---|
| 55 | # Here we define some helpers to know where |
---|
| 56 | # to plug into an existing LDAP directory |
---|
[1029] | 57 | #userbase: ou=People,dc=librelogiciel,dc=com |
---|
[1025] | 58 | #userrdn: uid |
---|
[1038] | 59 | #balancebase: ou=People,dc=librelogiciel,dc=com |
---|
| 60 | #balancerdn: uid |
---|
[1029] | 61 | #groupbase: ou=Groups,dc=librelogiciel,dc=com |
---|
[1025] | 62 | #grouprdn: cn |
---|
[1029] | 63 | #printerbase: ou=Printers,ou=PyKota,dc=librelogiciel,dc=com |
---|
[1025] | 64 | #printerrdn: cn |
---|
[1029] | 65 | #jobbase: ou=Jobs,ou=PyKota,dc=librelogiciel,dc=com |
---|
| 66 | #userquotabase: ou=UQuotas,ou=PyKota,dc=librelogiciel,dc=com |
---|
| 67 | #groupquotabase: ou=GQuotas,ou=PyKota,dc=librelogiciel,dc=com |
---|
| 68 | #lastjobbase: ou=LastJobs,ou=PyKota,dc=librelogiciel,dc=com |
---|
| 69 | # |
---|
| 70 | # Choose what attribute contains the list of group members |
---|
| 71 | # common values are : memberUid, uniqueMember, member |
---|
| 72 | #groupmembers: memberUid |
---|
[1016] | 73 | |
---|
[695] | 74 | # Where to log ? |
---|
[707] | 75 | # supported values : stderr, system (system means syslog, but don't use 'syslog' here) |
---|
[853] | 76 | # if the value is not set then the default SYSTEM applies. |
---|
[782] | 77 | logger: system |
---|
[695] | 78 | |
---|
[1047] | 79 | # Enable debugging ? Put YES instead here, |
---|
| 80 | # but only if something went wrong and you want |
---|
| 81 | # to learn from where the problem comes from. |
---|
| 82 | # Actually only database queries are logged. |
---|
[1021] | 83 | debug : No |
---|
| 84 | |
---|
[695] | 85 | # Mail server to use to warn users |
---|
[853] | 86 | # If the value is not set then localhost is used. |
---|
[695] | 87 | smtpserver: localhost |
---|
[806] | 88 | |
---|
[974] | 89 | # What is the accounting backend to use |
---|
| 90 | # |
---|
| 91 | # supported values : |
---|
| 92 | # |
---|
| 93 | # - querying : asks the printer for its lifetime page counter |
---|
[976] | 94 | # via either SNMP, AppleTalk, or any external |
---|
| 95 | # command. This method is the method used by |
---|
| 96 | # default in PyKota since its beginning. |
---|
| 97 | # |
---|
[980] | 98 | # - external : delegates the job's size computation to any |
---|
| 99 | # external command of your choice. A stupid and |
---|
| 100 | # completely unreliable example, but which |
---|
| 101 | # shows what this command may be is : |
---|
| 102 | # |
---|
| 103 | # accounter: external(/bin/grep -c showpage) |
---|
[1000] | 104 | # |
---|
| 105 | # Another one, which should work with all DSC |
---|
| 106 | # compliant Postscript files : |
---|
| 107 | # |
---|
| 108 | # accounter: external(/bin/grep -c "%%Page:") |
---|
[980] | 109 | # |
---|
[976] | 110 | # - stupid : counts the occurences of the 'showpage' postscript |
---|
[1001] | 111 | # statement in the document to be printed. |
---|
| 112 | # THIS IS NOT RELIABLE. This is just to serve as |
---|
[976] | 113 | # an example on how to implement your own accounting |
---|
| 114 | # method. |
---|
| 115 | # |
---|
[974] | 116 | # This value can be set either globally or on a per printer basis |
---|
[976] | 117 | # If both are defined, the printer option has priority. |
---|
| 118 | # if not set it defaults to 'querying'. |
---|
[994] | 119 | # |
---|
| 120 | # A script which seems to be accurate, copy it from the |
---|
| 121 | # untested/postscript directory to another place. |
---|
| 122 | # accounter: external(/usr/local/bin/pagecount.sh) |
---|
[1000] | 123 | # WARNING : it may not work when multiple copies are asked. |
---|
| 124 | # this breaks ghostscript, I don't know why yet. |
---|
[994] | 125 | # |
---|
| 126 | # default value |
---|
[974] | 127 | accounter: querying |
---|
[806] | 128 | |
---|
| 129 | # Print Quota administrator |
---|
| 130 | # These values can be set either globally or per printer or both. |
---|
| 131 | # If both are defined, the printer option has priority. |
---|
[853] | 132 | # If these values are not set, the default admin root |
---|
| 133 | # and the default adminmail root@localhost are used. |
---|
[806] | 134 | admin: Jerome Alet |
---|
| 135 | adminmail: alet@librelogiciel.com |
---|
| 136 | |
---|
[695] | 137 | # |
---|
[852] | 138 | # Who should we send an email to in case a quota is reached ? |
---|
| 139 | # possible values are : DevNull, User, Admin, Both |
---|
| 140 | # The Both value means that the User and the Admin will receive |
---|
| 141 | # an email message. |
---|
| 142 | # The DevNull value means no email message will be sent. |
---|
| 143 | # This value can be set either globally or per printer or both. |
---|
| 144 | # If both are defined, the printer option has priority. |
---|
[853] | 145 | # If the value is not set, then the default BOTH applies. |
---|
[852] | 146 | mailto: both |
---|
| 147 | |
---|
| 148 | # |
---|
[695] | 149 | # Grace delay in days |
---|
[806] | 150 | # This value can be set either globally or per printer or both. |
---|
| 151 | # If both are defined, the printer option has priority. |
---|
[853] | 152 | # If the value is not set then the default seven (7) days applies. |
---|
[695] | 153 | gracedelay: 7 |
---|
| 154 | |
---|
[853] | 155 | # one section per printer, or no other section at all if all options |
---|
[1025] | 156 | # are defined globally. |
---|
[1047] | 157 | # Each section's name must be the same as the printer's queue name as defined |
---|
[1025] | 158 | # in your printing system, be it CUPS or LPRng. |
---|
[1027] | 159 | # If you don't want any special printer section, just comment out |
---|
| 160 | # the line below so that following options are global. |
---|
[1025] | 161 | [hpmarketing] |
---|
[806] | 162 | |
---|
[1047] | 163 | # How to query the hpmarketing printer for its page counter. |
---|
[980] | 164 | # THIS IS ONLY USED IF YOU HAVE SET 'accounter' TO 'querying' |
---|
| 165 | # JUST COMMENT IT OUT IF YOU USE ANY OTHER ACCOUNTING METHOD. |
---|
[1002] | 166 | # (it would be ignored anyway) |
---|
| 167 | # |
---|
[1047] | 168 | # In the lines below "%(printer)s" is automatically replaced |
---|
| 169 | # at run time with your printer's Fully Qualified Domain Name |
---|
| 170 | # e.g. myprinter.domain.com |
---|
| 171 | # |
---|
[780] | 172 | # Only snmp(community, oid) and external(command) are supported |
---|
[903] | 173 | # |
---|
| 174 | # Example : |
---|
[1025] | 175 | # 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] | 176 | # and : |
---|
[998] | 177 | # requester: snmp(public, mib-2.43.10.2.1.4.1.1) |
---|
[794] | 178 | # are equivalent |
---|
[903] | 179 | # |
---|
| 180 | # Another untested example, using npadmin : |
---|
[1025] | 181 | # requester: external(/usr/bin/npadmin --pagecount %(printer)s) |
---|
[903] | 182 | # |
---|
[919] | 183 | # Another example, for AppleTalk printers which works fine : |
---|
[952] | 184 | # (You may need the pap CUPS backend installed, and copy the |
---|
| 185 | # pagecount.ps file from untested/netatalk into /etc or any |
---|
| 186 | # appropriate location) |
---|
[964] | 187 | # requester: external(/usr/bin/pap -p "%(printer)s:LaserWriter" /etc/pagecount.ps 2>/dev/null | grep -v status | grep -v Connect | tail -1) |
---|
[919] | 188 | # |
---|
[806] | 189 | # This value can be set either globally or per printer or both. |
---|
| 190 | # If both are defined, the printer option has priority. |
---|
[830] | 191 | # |
---|
[998] | 192 | # NB : The SNMP oid mib-2.43.10.2.1.4.1.1 works on HP Laserjet Printers, but it may |
---|
[830] | 193 | # be different with other brands, refer to your printer's documentation |
---|
[999] | 194 | # for details. Also you may have to specify -v2c or -v3 depending on your |
---|
| 195 | # printer's support for different versions of the SNMP specification. |
---|
[1002] | 196 | # |
---|
[1055] | 197 | # |
---|
| 198 | # Some examples and comments provided by Bob Martel from csuohio.edu |
---|
| 199 | # |
---|
| 200 | # For several printers I could not get the page count using snmpget. I |
---|
| 201 | # resorted to snmpwalk: |
---|
| 202 | # |
---|
| 203 | # 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) |
---|
| 204 | # |
---|
| 205 | # The last example is still more ugly, some of the printers only provided |
---|
| 206 | # their counters without names, but at least always on the same line: |
---|
| 207 | # |
---|
| 208 | # 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) |
---|
| 209 | # |
---|
| 210 | # |
---|
[1002] | 211 | # WARNING : In any case, when using an external requester, please test the command line outside |
---|
| 212 | # of PyKota before. This will save you some headaches in case it doesn't work as expected. |
---|
[1025] | 213 | 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 " ") |
---|
[806] | 214 | |
---|
[695] | 215 | # Default policy for inexistant users (e.g. root) |
---|
[713] | 216 | # either allow or deny |
---|
[806] | 217 | # This value can be set either globally or per printer or both. |
---|
| 218 | # If both are defined, the printer option has priority. |
---|
[956] | 219 | # If the value is not set then the default policy DENY applies. |
---|
| 220 | # ATTENTION : |
---|
[960] | 221 | # Before 1.04 the default value was ALLOW, but unknown users |
---|
[956] | 222 | # allowed to print causes accuracy problems : their jobs are |
---|
| 223 | # charged to the next person who prints on the same printer. |
---|
[1038] | 224 | # There's no policy wrt inexistant groups, they are ignored. |
---|
[956] | 225 | policy: deny |
---|