1 | # PyKota sample configuration file |
---|
2 | # |
---|
3 | # |
---|
4 | # File format : |
---|
5 | # |
---|
6 | # - A mandatory [global] section : |
---|
7 | # |
---|
8 | # Contains configuration directives which apply for all printers. |
---|
9 | # Some directives MUST be set in the [global] section, e.g. |
---|
10 | # database related directives. |
---|
11 | # |
---|
12 | # - Any number of optional [PrintQueueName] sections : |
---|
13 | # |
---|
14 | # Contain directives which apply for a particular print queue only. |
---|
15 | # |
---|
16 | # Override the values of the same directives present in [global]. |
---|
17 | # |
---|
18 | # |
---|
19 | # Directives format : |
---|
20 | # |
---|
21 | # - Directive's name, followed by ':' followed by the directive's value. |
---|
22 | # |
---|
23 | # - No leading whitespace : leading whitespace tell the parser that the |
---|
24 | # current directive is the continuation of the previous one. Use with |
---|
25 | # care and only when you need it. |
---|
26 | # |
---|
27 | # |
---|
28 | # PyKota - Print Quotas for CUPS and LPRng |
---|
29 | # |
---|
30 | # (c) 2003, 2004, 2005 Jerome Alet <alet@librelogiciel.com> |
---|
31 | # This program is free software; you can redistribute it and/or modify |
---|
32 | # it under the terms of the GNU General Public License as published by |
---|
33 | # the Free Software Foundation; either version 2 of the License, or |
---|
34 | # (at your option) any later version. |
---|
35 | # |
---|
36 | # This program is distributed in the hope that it will be useful, |
---|
37 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
38 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
39 | # GNU General Public License for more details. |
---|
40 | # |
---|
41 | # You should have received a copy of the GNU General Public License |
---|
42 | # along with this program; if not, write to the Free Software |
---|
43 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
---|
44 | # |
---|
45 | # $Id$ |
---|
46 | # |
---|
47 | |
---|
48 | [global] |
---|
49 | # Storage backend for quotas |
---|
50 | # only PGStorage (PostgreSQL) and LDAPStorage (OpenLDAP) are supported. |
---|
51 | # MySQL and BerkeleyDB are planned. |
---|
52 | |
---|
53 | # the 'postgresql' value is deprecated, use 'pgstorage' instead. |
---|
54 | storagebackend: pgstorage |
---|
55 | |
---|
56 | # Quota Storage Server hostname (and optional port) |
---|
57 | # e.g. db.example.com:5432 |
---|
58 | storageserver: localhost |
---|
59 | |
---|
60 | # |
---|
61 | # name of the Quota Storage Database |
---|
62 | storagename: pykota |
---|
63 | |
---|
64 | # |
---|
65 | # Quota Storage normal user's name and password |
---|
66 | # These two fields contain a username and optional password |
---|
67 | # which may give readonly access to your print quota database. |
---|
68 | # |
---|
69 | # PLEASE ENSURE THAT THIS USER CAN'T WRITE TO YOUR PRINT QUOTA |
---|
70 | # DATABASE, OTHERWISE ANY USER WHO COULD READ THIS CONFIGURATION |
---|
71 | # FILE COULD CHANGE HIS PRINT QUOTA. |
---|
72 | # |
---|
73 | storageuser: pykotauser |
---|
74 | # storageuserpw: Comment out if unused, or set to Quota Storage user password |
---|
75 | |
---|
76 | # Should the database caching mechanism be enabled or not ? |
---|
77 | # If unset, caching is disabled. Possible values Y/N/YES/NO |
---|
78 | # caching mechanism works with both PostgreSQL and OpenLDAP backends |
---|
79 | # but may be really interesting only with OpenLDAP. |
---|
80 | # |
---|
81 | # ACTIVATING CACHE MAY CAUSE PRECISION PROBLEMS IN PRINT ACCOUNTING |
---|
82 | # IF AN USER PRINTS ON SEVERAL PRINTERS AT THE SAME TIME. |
---|
83 | # YOU MAY FIND IT INTERESTING ANYWAY, ESPECIALLY FOR LDAP. |
---|
84 | # |
---|
85 | # FYI, I ALWAYS SET IT TO YES ! |
---|
86 | # |
---|
87 | storagecaching: No |
---|
88 | |
---|
89 | # Should full job history be disabled ? |
---|
90 | # If unset or set to No, full job history is kept in the database. |
---|
91 | # This will be useful in the future when the report generator |
---|
92 | # will be written. |
---|
93 | # Disabling the job history can be useful with heavily loaded |
---|
94 | # LDAP servers, to not make the LDAP tree grow out of control. |
---|
95 | # Disabling the job history with the PostgreSQL backend works too |
---|
96 | # but it's probably less useful than with LDAP. |
---|
97 | disablehistory: No |
---|
98 | |
---|
99 | # LDAP example, uncomment and adapt it to your own configuration : |
---|
100 | #storagebackend: ldapstorage |
---|
101 | #storageserver: ldap://ldap.librelogiciel.com:389 |
---|
102 | #storagename: dc=librelogiciel,dc=com |
---|
103 | #storageuser: cn=notadmin,dc=librelogiciel,dc=com |
---|
104 | #storageuserpw: abc.123 |
---|
105 | # |
---|
106 | # TLS support for LDAP |
---|
107 | # |
---|
108 | # ldaptls can be set to either Yes or No |
---|
109 | # the default value when not set is No, meaning that TLS won't be used. |
---|
110 | #ldaptls: No |
---|
111 | # |
---|
112 | # cacert points to the CA Certificate file to use for TLS. |
---|
113 | # Ensure that every user who can launch PyKota commands can read this file. |
---|
114 | # There's NO default value for this directive. |
---|
115 | #cacert /etc/pykota/mycertfile |
---|
116 | # |
---|
117 | # |
---|
118 | # Here we define some helpers to know where |
---|
119 | # to plug into an existing LDAP directory |
---|
120 | #userbase: ou=People,dc=librelogiciel,dc=com |
---|
121 | #userrdn: uid |
---|
122 | #balancebase: ou=People,dc=librelogiciel,dc=com |
---|
123 | #balancerdn: uid |
---|
124 | #groupbase: ou=Groups,dc=librelogiciel,dc=com |
---|
125 | #grouprdn: cn |
---|
126 | #printerbase: ou=Printers,ou=PyKota,dc=librelogiciel,dc=com |
---|
127 | #printerrdn: cn |
---|
128 | #jobbase: ou=Jobs,ou=PyKota,dc=librelogiciel,dc=com |
---|
129 | #lastjobbase: ou=LastJobs,ou=PyKota,dc=librelogiciel,dc=com |
---|
130 | |
---|
131 | # These two fields are special, they either accept a branch |
---|
132 | # dn, like an ou for example, or the special keywords 'user' |
---|
133 | # and 'group'. If 'user' or 'group' is used, the print quota |
---|
134 | # entries will be created below the user or group entry itself, |
---|
135 | # which will then be used like a branch (you can mix and match |
---|
136 | # different values depending on what you want to do). |
---|
137 | #userquotabase: user |
---|
138 | #userquotabase: ou=UQuotas,ou=PyKota,dc=librelogiciel,dc=com |
---|
139 | #groupquotabase: group |
---|
140 | #groupquotabase: ou=GQuotas,ou=PyKota,dc=librelogiciel,dc=com |
---|
141 | |
---|
142 | # |
---|
143 | # How to create new accounts and groups |
---|
144 | # authorized values are "below" and "attach(objectclass name [, fail|warn])" |
---|
145 | # |
---|
146 | # "below" creates the new accounts/groups as standalone entries |
---|
147 | # below the above defined 'userbase' ou |
---|
148 | # |
---|
149 | # attach(objectclass name [, action]) tries to find some existing user/group |
---|
150 | # using the above defined 'userrdn' or 'grouprdn' and 'userbase' |
---|
151 | # 'groupbase', and attach the PyKota specific entries to it. |
---|
152 | # if action is "warn" and no entry exists to attach to, a new |
---|
153 | # entry is created, and a message is logged. |
---|
154 | # if action is "fail" and no entry exists to attach to, program |
---|
155 | # logs an error message and aborts. |
---|
156 | # if action is not set, the default value is "fail". |
---|
157 | # |
---|
158 | # a possible value: newuser: attach(posixAccount, warn) |
---|
159 | #newuser : below |
---|
160 | #newgroup : below |
---|
161 | # |
---|
162 | # LDAP attribute which stores the user's email address |
---|
163 | #usermail : mail |
---|
164 | |
---|
165 | # |
---|
166 | # Choose what attribute contains the list of group members |
---|
167 | # common values are : memberUid, uniqueMember, member |
---|
168 | #groupmembers: memberUid |
---|
169 | |
---|
170 | # Activate low-level LDAP cache yes/no |
---|
171 | # Nothing to do with "storagecaching" which is higher level |
---|
172 | # and database independant. |
---|
173 | # This saves some search queries and may help with heavily |
---|
174 | # loaded LDAP servers. |
---|
175 | # This is EXPERIMENTAL. |
---|
176 | # |
---|
177 | # BEWARE : SETTING THIS TO 'YES' CAUSES PROBLEMS FOR NOW |
---|
178 | # BETTER TO LET IT SET TO 'NO' |
---|
179 | # ldapcache: no |
---|
180 | |
---|
181 | # Where to log ? |
---|
182 | # supported values : stderr, system (system means syslog, but don't use 'syslog' here) |
---|
183 | # if the value is not set then the default SYSTEM applies. |
---|
184 | logger: system |
---|
185 | |
---|
186 | # Enable debugging ? Put YES or NO there. |
---|
187 | # debug is set to yes in this sample |
---|
188 | # configuration file, so debugging is activated |
---|
189 | # when configuring PyKota. After all works, just |
---|
190 | # put NO instead to save some disk space in your |
---|
191 | # logs. |
---|
192 | debug : Yes |
---|
193 | |
---|
194 | # Mail server to use to warn users |
---|
195 | # If the value is not set then localhost is used. |
---|
196 | smtpserver: localhost |
---|
197 | |
---|
198 | # Crash messages' recipient : in addition to the log files |
---|
199 | # each software crash can be sent to the author of PyKota |
---|
200 | # or any other person of your choice. By default this |
---|
201 | # is disabled. The recipient pykotacrashed@librelogiciel.com |
---|
202 | # reaches PyKota's author. |
---|
203 | # The 'adminmail' (defined a bit below) is CCed. |
---|
204 | # |
---|
205 | # Privacy concerns : what is sent is only : |
---|
206 | # |
---|
207 | # - a copy of the software's traceback |
---|
208 | # - a copy of the software's command line arguments |
---|
209 | # - a copy of the software's environment variables |
---|
210 | # |
---|
211 | # suggested value |
---|
212 | # crashrecipient: pykotacrashed@librelogiciel.com |
---|
213 | |
---|
214 | # Email domain |
---|
215 | # If the value is not set, and the mail attribute for the user |
---|
216 | # is not set in the PyKota storage, be it LDAP (see usermail directive |
---|
217 | # above) or PostgreSQL, then email messages are sent to |
---|
218 | # username@smtpserver |
---|
219 | # |
---|
220 | # If the value is set, then email messages are sent to |
---|
221 | # username@maildomain using the SMTP server defined above |
---|
222 | # |
---|
223 | # Set the appropriate value below, example.com set as per RFC2606. |
---|
224 | maildomain: example.com |
---|
225 | |
---|
226 | # Should we force usernames to be all lowercase when printing ? |
---|
227 | # Default is No. |
---|
228 | # This is a global option only. |
---|
229 | # Some people reported that WinXP sends mixed case usernames |
---|
230 | # setting 'utolower: Yes' solves the problem. |
---|
231 | # Of course you have to use lowercase only when adding |
---|
232 | # users with edpykota, because ALL database accesses are |
---|
233 | # still case sensitive. |
---|
234 | # |
---|
235 | # If utolower is Yes, the usernames received from the printing |
---|
236 | # system is converted to lowercase at the start of the cupspykota |
---|
237 | # backend or of the lprngpykota filter. |
---|
238 | # |
---|
239 | # If utolower is No, which is the default, strict case checking |
---|
240 | # is done, this means that users 'Jerome' and 'jerome' are |
---|
241 | # different. Printer and groups names are ALWAYS case sensitive. |
---|
242 | utolower: No |
---|
243 | |
---|
244 | # Should we split usernames on a specific separator when printing ? |
---|
245 | # Default is No, i.e. if the value is unset. |
---|
246 | # This is a global option only. |
---|
247 | # This option adds support for Samba's Winbind utility, which |
---|
248 | # prefixes usernames with domain name and separator character. |
---|
249 | # Of course if you set this then you have to use NO separator when |
---|
250 | # adding users with edpykota. |
---|
251 | # |
---|
252 | # If winbind_separator is set, the usernames received from the printing |
---|
253 | # system are split on the separator's value, and only the last part |
---|
254 | # (real username) is used. |
---|
255 | # |
---|
256 | # If winbind_separator is not set, which is the default, strict |
---|
257 | # username equality checking will be done (modulo the setting |
---|
258 | # of the 'utolower' directive), this means that users 'DOMAIN1/jerome', |
---|
259 | # 'Domain2/jerome' and 'jerome' are different. |
---|
260 | # winbind_separator: / |
---|
261 | |
---|
262 | # When creating users or groups accounts, should we reject users |
---|
263 | # or groups which are unknown from the system ? |
---|
264 | # The default if unset is NO. This means that by default, you |
---|
265 | # can create users or groups for which `getent passwd username` |
---|
266 | # or `getent group groupname` returns nothing. |
---|
267 | # |
---|
268 | # Allowed values : Yes | No |
---|
269 | # Default value : No |
---|
270 | # |
---|
271 | # reject_unknown: No |
---|
272 | |
---|
273 | # Do we want to hide jobs' title, filename and options for privacy |
---|
274 | # reasons ? |
---|
275 | # This may be required in some countries (Italy comes to mind). |
---|
276 | # Allowed values are YES and NO. |
---|
277 | # If unset, the default value is NO, meaning that jobs' title, filename |
---|
278 | # and options will be saved into the history. |
---|
279 | # This option can't be set on a per printer basis, only into the |
---|
280 | # [global] section. |
---|
281 | privacy : no |
---|
282 | |
---|
283 | # What is the accounting backend to use |
---|
284 | # |
---|
285 | # supported values : |
---|
286 | # |
---|
287 | # - hardware : asks the printer for its lifetime page counter |
---|
288 | # via either SNMP, AppleTalk, or any external |
---|
289 | # command. This method is the recommended one |
---|
290 | # in PyKota since its beginning. |
---|
291 | # |
---|
292 | # In the lines below "%(printer)s" is automatically replaced |
---|
293 | # at run time with your printer's Fully Qualified Domain Name |
---|
294 | # for network printers, if PyKota can extract it from its |
---|
295 | # environment. |
---|
296 | # e.g. myprinter.example.com |
---|
297 | # |
---|
298 | # Recommended values : |
---|
299 | # |
---|
300 | # accounter: hardware(snmp) |
---|
301 | # |
---|
302 | # Extracts the printer's internal page counter via SNMP. |
---|
303 | # |
---|
304 | # Or : |
---|
305 | # |
---|
306 | # accounter: hardware(pjl) |
---|
307 | # |
---|
308 | # Extracts the printer's internal page counter via PJL queries over port tcp/9100. |
---|
309 | # |
---|
310 | # Other Examples : |
---|
311 | # |
---|
312 | # accounter: hardware(/usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") |
---|
313 | # |
---|
314 | # Another untested example, using npadmin : |
---|
315 | # |
---|
316 | # accounter: hardware(/usr/bin/npadmin --pagecount %(printer)s) |
---|
317 | # |
---|
318 | # Another example, for AppleTalk printers which works fine : |
---|
319 | # (You may need the pap CUPS backend installed, and copy the |
---|
320 | # pagecount.ps file from untested/netatalk into /etc or any |
---|
321 | # appropriate location) |
---|
322 | # |
---|
323 | # accounter: hardware(/usr/share/pykota/papwaitprinter.sh "MyPrinter:LaserWriter@*" && /usr/bin/pap -p "MyPrinter:LaserWriter@*" /usr/share/pykota/pagecount.ps 2>/dev/null | /bin/grep -v status | /bin/grep -v Connect | /usr/bin/tail -1) |
---|
324 | # |
---|
325 | # An example for parallel printers like the HP Laserjet 5MP : |
---|
326 | # |
---|
327 | # accounter: hardware(/bin/cat /usr/share/pykota/pagecount.pjl >/dev/lp0 && /usr/bin/head -2 </dev/lp0 | /usr/bin/tail -1) |
---|
328 | # |
---|
329 | # This value can be set either globally or per printer or both. |
---|
330 | # If both are defined, the printer option has priority. |
---|
331 | # |
---|
332 | # Some examples and comments provided by Bob Martel from csuohio.edu |
---|
333 | # |
---|
334 | # For several printers I could not get the page count using snmpget. I |
---|
335 | # resorted to snmpwalk: |
---|
336 | # |
---|
337 | # accounter: hardware(/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) |
---|
338 | # |
---|
339 | # The last example is still more ugly, some of the printers only provided |
---|
340 | # their counters without names, but at least always on the same line: |
---|
341 | # |
---|
342 | # accounter: hardware(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public -Ov %(printer)s | grep Counter32 | tail -2 | head -1 | cut -d " " -f2) |
---|
343 | # |
---|
344 | # An example using netcat and a preformatted PJL job which you can find |
---|
345 | # in the untested/pjl directory, which is sent to a JetDirect print |
---|
346 | # server on port 9100 : |
---|
347 | # |
---|
348 | # accounter: hardware(/bin/nc -w 2 %(printer)s 9100 </usr/share/pykota/pagecount.pjl | /usr/bin/tail -2) |
---|
349 | # |
---|
350 | # An example using the contributed pagecount.pl script which does |
---|
351 | # the same as above, but should work on more printers : |
---|
352 | # |
---|
353 | # accounter: hardware(LC_ALL=C /usr/share/pykota/pagecount.pl %(printer)s 9100) |
---|
354 | # |
---|
355 | # NB : the LC_ALL=C is used because sometimes Perl can correctly set locale and is verbose |
---|
356 | # about it, causing PyKota to miss the correct answer. |
---|
357 | # |
---|
358 | # WARNING : In any case, when using an hardware accounter, please test the command line outside |
---|
359 | # of PyKota before. This will save you some headaches in case it doesn't work as expected. |
---|
360 | # |
---|
361 | # The waitprinter.sh is there to wait until the printer is idle again. |
---|
362 | # This should prevent a job to be sent to the printer while another one is |
---|
363 | # not yet finished (not all pages are printed, but the complete job is in |
---|
364 | # the printer) |
---|
365 | # |
---|
366 | # YOU ABSOLUTELY HAVE TO BE SURE YOU HAVE A SCRIPT WHICH WAITS FOR THE |
---|
367 | # PRINTER BEING READY BEFORE ASKING FOR ITS INTERNAL PAGE COUNTER. |
---|
368 | # |
---|
369 | # PYKOTA INCLUDES SUCH SCRIPTS FOR SNMP AND APPLETALK PRINTERS, MORE TO COME |
---|
370 | # |
---|
371 | # SOME OF THE ABOVE EXAMPLES DON'T USE SUCH A SCRIPT, YOU HAVE BEEN WARNED |
---|
372 | # |
---|
373 | # |
---|
374 | # WITH THE SPECIAL MAGIC hardware(snmp) AND hardware(pjl) VALUES, PYKOTA |
---|
375 | # TAKES CARE OF ALL THIS FOR YOU, SO PLEASE UNDERSTAND THAT IT IS PREFERABLE |
---|
376 | # TO USE THESE TWO METHODS : THEY WORK FINE, REQUIRE LITTLE TO NO CPU, |
---|
377 | # AND DO ALL THE HARD WORK AUTOMATICALLY. IF YOU REALLY NEED TO YOU CAN USE |
---|
378 | # YOUR OWN EXTERNAL COMMANDS AS DESCRIBED ABOVE, JUST BE CAREFUL WITH THIS. |
---|
379 | # |
---|
380 | # |
---|
381 | # - software : delegates the job's size computation to any |
---|
382 | # external command of your choice. |
---|
383 | # |
---|
384 | # best choice for this is probably to set it |
---|
385 | # this way : |
---|
386 | # |
---|
387 | # accounter: software() |
---|
388 | # |
---|
389 | # which uses PyKota's internal parser to compute |
---|
390 | # the size of the job. |
---|
391 | # |
---|
392 | # You could obtain exactly the same result with : |
---|
393 | # |
---|
394 | # accounter: software(/usr/bin/pkpgcounter) |
---|
395 | # |
---|
396 | # But in this case the job would be passed through |
---|
397 | # PyKota's internal parser a second time. |
---|
398 | # |
---|
399 | # pkpgcounter is a command line tool which is |
---|
400 | # part of PyKota and which can handle both |
---|
401 | # DSC compliant or binary PostScript, PCL5, PCL6 (aka PCLXL) |
---|
402 | # and PDF documents. More file formats will be added |
---|
403 | # in the future, as time permits. |
---|
404 | # |
---|
405 | # while pkpgcounter is the recommended value if you want |
---|
406 | # to use an external command here, you can use whatever |
---|
407 | # command you want provided your command accepts the job's |
---|
408 | # data on its standard input and prints the job's size in |
---|
409 | # pages as a single integer on its standard output. |
---|
410 | # |
---|
411 | # This value can be set either globally or on a per printer basis |
---|
412 | # If both are defined, the printer option has priority. |
---|
413 | # |
---|
414 | # accounter: hardware(/usr/share/pykota/waitprinter.sh %(printer)s && /usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") |
---|
415 | # accounter: hardware(snmp) |
---|
416 | # accounter: hardware(pjl) |
---|
417 | # accounter: software(/usr/bin/pkpgcounter) |
---|
418 | # |
---|
419 | # The following is only allowed since PyKota 1.21 |
---|
420 | accounter: software() |
---|
421 | |
---|
422 | # What should we do if the accounter's subprocess doesn't return |
---|
423 | # a valid result (for example doesn't return an integer on its stdout) |
---|
424 | # |
---|
425 | # Valid values are : 'continue' and 'stop'. 'stop' is the default |
---|
426 | # if unset. |
---|
427 | # |
---|
428 | # 'continue' means try to process as usual, this may introduce |
---|
429 | # accounting errors and free jobs. This was the default behavior |
---|
430 | # until v1.20alpha5. |
---|
431 | # |
---|
432 | # 'stop' means fail and stop the print queue. If an accounter |
---|
433 | # error occurs, most of the time this is a misconfiguration, so |
---|
434 | # stopping the print queue is usually the better thing to do |
---|
435 | # until the admin has fixed the configuration. |
---|
436 | # |
---|
437 | # This value can be set either globally or on a per printer basis |
---|
438 | # If both are defined, the printer option has priority. |
---|
439 | # |
---|
440 | # NB : This directive shouldn't do much now because in case |
---|
441 | # of external accounter error, PyKota just loops. |
---|
442 | # |
---|
443 | # onaccountererror: continue |
---|
444 | onaccountererror: stop |
---|
445 | |
---|
446 | # Print Quota administrator |
---|
447 | # These values can be set either globally or per printer or both. |
---|
448 | # If both are defined, the printer option has priority. |
---|
449 | # If these values are not set, the default admin root |
---|
450 | # and the default adminmail root@localhost are used. |
---|
451 | admin: John Doe |
---|
452 | adminmail: root@localhost |
---|
453 | |
---|
454 | # |
---|
455 | # Who should we send an email to in case a quota is reached ? |
---|
456 | # possible values are : DevNull, User, Admin, Both, External(some command) |
---|
457 | # The Both value means that the User and the Admin will receive |
---|
458 | # an email message. |
---|
459 | # The DevNull value means no email message will be sent. |
---|
460 | # This value can be set either globally or per printer or both. |
---|
461 | # If both are defined, the printer option has priority. |
---|
462 | # If the value is not set, then the default BOTH applies. |
---|
463 | # |
---|
464 | # Format of the external syntax : |
---|
465 | # |
---|
466 | # mailto: external(/usr/bin/mycommand >/dev/null) |
---|
467 | # |
---|
468 | # You can use : |
---|
469 | # |
---|
470 | # '%(action)s' will contain either WARN or DENY |
---|
471 | # '%(username)s' will contain the user's name |
---|
472 | # '%(printername)s' will contain the printer's name |
---|
473 | # '%(email)s' will contain the user's email address |
---|
474 | # '%(message)s' will contain the message if you want |
---|
475 | # to use it. |
---|
476 | # |
---|
477 | # On your command line, to pass arguments to your command. |
---|
478 | # Example : |
---|
479 | # |
---|
480 | # mailto: external(/usr/bin/callpager %(username)s "Quota problem on %(printername)s" >/dev/null) |
---|
481 | # |
---|
482 | # To automatically send a WinPopup message (this may only work with a PDC, |
---|
483 | # here the same machine does Samba as PDC + CUPS) : |
---|
484 | # |
---|
485 | # mailto: external(echo "%(message)s" | /usr/bin/iconv --to-code utf-8 --from-code iso-8859-15 | /usr/bin/smbclient -M "%(username)s" 2>&1 >/dev/null) |
---|
486 | # |
---|
487 | # NB : I use ISO-8859-15, but Windows expects UTF-8, so we pipe the message |
---|
488 | # into iconv before sending it to the Windows user. |
---|
489 | # |
---|
490 | # or more simply : |
---|
491 | # |
---|
492 | # mailto: external(/usr/share/pykota/mailandpopup.sh %(username)s %(printername)s "%(email)s" "%(message)s" 2>&1 >/dev/null) |
---|
493 | # |
---|
494 | # NB : The mailandpopup.sh shell script is now included in PyKota |
---|
495 | # |
---|
496 | # NB : in ANY case, don't forget to redirect your command's standard output |
---|
497 | # somewhere (e.g. >/dev/null) so that there's no perturbation to the |
---|
498 | # underlying layer (filter or backend) |
---|
499 | # |
---|
500 | mailto: both |
---|
501 | |
---|
502 | # |
---|
503 | # Grace delay in days |
---|
504 | # This value can be set either globally or per printer or both. |
---|
505 | # If both are defined, the printer option has priority. |
---|
506 | # If the value is not set then the default seven (7) days applies. |
---|
507 | gracedelay: 7 |
---|
508 | |
---|
509 | # |
---|
510 | # Poor man's threshold |
---|
511 | # If account balance reaches below this amount, |
---|
512 | # a warning message is sent by email |
---|
513 | # |
---|
514 | # If unset, default poor man's threshold is 1.0. |
---|
515 | # This option can only appear in the global section |
---|
516 | poorman: 2.0 |
---|
517 | |
---|
518 | # Poor man's warning message |
---|
519 | # The warning message that is sent if the "poorman" value is reached |
---|
520 | # Again this must appear in the global section |
---|
521 | poorwarn: Your Print Quota account balance is low. |
---|
522 | Soon you'll not be allowed to print anymore. |
---|
523 | |
---|
524 | # Soft limit reached warning message |
---|
525 | # The warning message that is sent if the soft quota limit is reached |
---|
526 | # May appear either globally or on a per-printer basis |
---|
527 | softwarn: Your Print Quota Soft Limit is reached. |
---|
528 | This means that you may still be allowed to print for some |
---|
529 | time, but you must contact your administrator to purchase |
---|
530 | more print quota. |
---|
531 | |
---|
532 | # Hard limit reached error message |
---|
533 | # The error message that is sent if the hard quota limit is reached |
---|
534 | # May appear either globally or on a per-printer basis |
---|
535 | hardwarn: Your Print Quota Hard Limit is reached. |
---|
536 | This means that you are not allowed to print anymore. |
---|
537 | Please contact your administrator at root@localhost |
---|
538 | as soon as possible to solve the problem. |
---|
539 | |
---|
540 | # one section per printer, or no other section at all if all options |
---|
541 | # are defined globally. |
---|
542 | # Each section's name must be the same as the printer's queue name as defined |
---|
543 | # in your printing system, be it CUPS or LPRng, between square brackets, for |
---|
544 | # example a print queue named 'hpmarketing' would appear in this file as |
---|
545 | # [hpmarketing] |
---|
546 | |
---|
547 | |
---|
548 | # Default policy to apply when either : |
---|
549 | # |
---|
550 | # - Printer doesn't exist in PyKota's database |
---|
551 | # - User doesn't exist in PyKota's database |
---|
552 | # - User has no quota entry for this Printer in PyKota's database |
---|
553 | # |
---|
554 | # Value can be either allow or deny or external(some command here) |
---|
555 | # |
---|
556 | # This value can be set either globally or per printer or both. |
---|
557 | # If both are defined, the printer option has priority. |
---|
558 | # If the value is not set then the default policy DENY applies. |
---|
559 | # There's no policy wrt inexistant groups, they are ignored. |
---|
560 | # |
---|
561 | # external policy can be used to launch any external command of your choice, |
---|
562 | # for example to automatically add the user to the quota storage |
---|
563 | # if he is unknown. Example : |
---|
564 | # |
---|
565 | # policy: external(/usr/bin/edpykota --add --printer %(printername)s --softlimit 50 --hardlimit 60 %(username)s >/dev/null) |
---|
566 | # |
---|
567 | # NB : If you want to limit users by their account balance value, it is preferable to |
---|
568 | # use the following policy to automate user account creation on first print : |
---|
569 | # |
---|
570 | # policy: external(/usr/bin/autopykota --initbalance 25.0 >/dev/null) |
---|
571 | # |
---|
572 | # This will automatically add the user if he doesn't already exist, and |
---|
573 | # set his initial balance value to 25.0 (for example). If the user already |
---|
574 | # exists then his balance value will not be modified. |
---|
575 | # Please don't use autopykota if you want to limit your users by page |
---|
576 | # quota, and in any case, carefully read autopykota's help or manpage |
---|
577 | # and understand its goal before using it in your own configuration. |
---|
578 | # |
---|
579 | # Of course you can launch any command of your choice with this, e.g. : |
---|
580 | # |
---|
581 | # policy: external(/usr/local/bin/myadminscript.sh %(username)s >/dev/null) |
---|
582 | |
---|
583 | # You can use : |
---|
584 | # |
---|
585 | # '%(username)s' will contain the user's name |
---|
586 | # '%(printername)s' will contain the printer's name |
---|
587 | # |
---|
588 | # On your command line, to pass arguments to your command. |
---|
589 | # |
---|
590 | # NB : Don't forget to redirect your command's standard output somewhere |
---|
591 | # (e.g. >/dev/null) so that there's no perturbation to the underlying |
---|
592 | # layer (filter or backend) |
---|
593 | # |
---|
594 | # If the printer, user, or user quota entry still doesn't exist after |
---|
595 | # external policy command was launched (the external command didn't add it), |
---|
596 | # or if an error occured during the execution of the external policy |
---|
597 | # command, then the job is rejected. |
---|
598 | # |
---|
599 | policy: deny |
---|
600 | |
---|
601 | # Pre and Post Hooks |
---|
602 | # These directives allow the easy plug-in of any command of your choice |
---|
603 | # at different phases of PyKota's execution. |
---|
604 | # Pre and Post Hooks can access some of PyKota's internal information |
---|
605 | # by reading environment variables as described below. |
---|
606 | # The actual phase of PyKota's execution is available in the |
---|
607 | # PYKOTAPHASE environment variable. |
---|
608 | # Pre and Post Hooks can be defined either globally, per printer, |
---|
609 | # or both. If both are defined, the printer specific hook has |
---|
610 | # priority. |
---|
611 | # |
---|
612 | # List of available environment variables : |
---|
613 | # NB : Most of these variables are also available during the execution |
---|
614 | # of external commands defined in the accounter and mailto |
---|
615 | # directives. |
---|
616 | # |
---|
617 | # PYKOTAMD5SUM : Contains an hexadecimal digest of the md5 sum of the job's datas |
---|
618 | # PYKOTAPHASE : BEFORE or AFTER the job is sent to the printer |
---|
619 | # PYKOTAACTION : ALLOW or DENY or WARN for current print job |
---|
620 | # PYKOTAUSERNAME : user's name |
---|
621 | # PYKOTAPRINTERNAME : printer's name |
---|
622 | # PYKOTAPGROUPS : list of printers groups the current printer is a member of |
---|
623 | # PYKOTAJOBID : job's id |
---|
624 | # PYKOTATITLE : job's title |
---|
625 | # PYKOTAFILENAME : job's filename |
---|
626 | # PYKOTACOPIES : number of copies |
---|
627 | # PYKOTAOPTIONS : job's options |
---|
628 | # PYKOTABALANCE : user's account balance |
---|
629 | # PYKOTALIFETIMEPAID : user's grand total paid |
---|
630 | # PYKOTALIMITBY : user print limiting factor, for example 'quota' or 'balance' |
---|
631 | # PYKOTAPAGECOUNTER : user's page counter on this printer |
---|
632 | # PYKOTALIFEPAGECOUNTER : user's life time page counter on this printer |
---|
633 | # PYKOTASOFTLIMIT : user's soft page limit on this printer |
---|
634 | # PYKOTAHARDLIMIT : user's hard page limit on this printer |
---|
635 | # PYKOTADATELIMIT : user's soft to hard limit date limit on this printer |
---|
636 | # PYKOTASTATUS : contains "CANCELLED" when SIGTERM was received by PyKota |
---|
637 | # else is not set. |
---|
638 | # PYKOTAJOBSIZEBYTES : contains the job's size in bytes. Always available. |
---|
639 | # PYKOTAPRECOMPUTEDJOBSIZE : contains the precomputed job's size |
---|
640 | # PYKOTAPRECOMPUTEDJOBPRICE : contains the precomputed job's price |
---|
641 | # PYKOTAJOBORIGINATINGHOSTNAME : contains the client's hostname if |
---|
642 | # it is possible to retrieve it. |
---|
643 | # PYKOTAPRINTERHOSTNAME : the printer's hostname or IP address for network |
---|
644 | # printers, or "localhost" if not defined or not |
---|
645 | # meaningful. |
---|
646 | # PYKOTAWARNCOUNT : the number of times the user was forbidden to print but a banner |
---|
647 | # page was still printed on the current printer. |
---|
648 | # PYKOTAOVERCHARGE : user's overcharging factor. |
---|
649 | # PYKOTAJOBBILLING : Job's billing code if present (CUPS only) |
---|
650 | # |
---|
651 | |
---|
652 | # PreHook : gets executed after being sure the user, printer and user quota |
---|
653 | # entry on the printer both exist in the PyKota database, and after |
---|
654 | # checking if the user is allowed to print or not, but just before |
---|
655 | # the job is sent to the printer (if allowed) |
---|
656 | # prehook has access to many environment variables : |
---|
657 | # |
---|
658 | # PYKOTAACTION contains either "ALLOW", "WARN" or "DENY" and |
---|
659 | # represents the action which is to be done wrt the print job. |
---|
660 | # PYKOTAPHASE contains 'BEFORE' during execution of prehook |
---|
661 | # |
---|
662 | # uncomment the line below to see what environment variables are available |
---|
663 | # prehook: /usr/bin/printenv >/tmp/before |
---|
664 | |
---|
665 | # PostHook : gets executed after the job has been added to the history. |
---|
666 | # posthook has access to all the environment variables defined above, |
---|
667 | # as well as two additionnal environment variables : PYKOTAJOBPRICE |
---|
668 | # and PYKOTAJOBSIZE. |
---|
669 | # PYKOTAPHASE contains 'AFTER' during execution of posthook. |
---|
670 | # |
---|
671 | # uncomment the line below to see what environment variables are available |
---|
672 | # posthook: /usr/bin/printenv >/tmp/after |
---|
673 | |
---|
674 | # AccountBanner : how should banner accounting be done ? |
---|
675 | # |
---|
676 | # NB : CUPS ONLY FOR NOW ! |
---|
677 | # |
---|
678 | # If enabled, banner pages printed from StartingBanner and/or EndingBanner |
---|
679 | # (depending on the value) will be included in the accounting for the |
---|
680 | # print job |
---|
681 | # |
---|
682 | # If disabled, banner pages printed from StartingBanner and EndingBanner will |
---|
683 | # *not* be included in the accounting for the print job |
---|
684 | # |
---|
685 | # IMPORTANT : CUPS generated banners are ALWAYS accounted for, although you |
---|
686 | # can refund them by using negative prices on printers. |
---|
687 | # |
---|
688 | # Allowed values : Starting | Ending | None | Both |
---|
689 | # |
---|
690 | # - Starting : only the starting banner will be accounted for. |
---|
691 | # - Ending : only the ending banner will be accounted for. |
---|
692 | # - Both : both starting and ending banners will be accounted for. |
---|
693 | # - None : banners will not be accounted for. |
---|
694 | # |
---|
695 | # Default value : |
---|
696 | # accountbanner: Both |
---|
697 | |
---|
698 | # Maximal number of times the banner will still be printed if |
---|
699 | # the user is forbidden to print. |
---|
700 | # |
---|
701 | # NB : CUPS ONLY FOR NOW ! |
---|
702 | # |
---|
703 | # This option can be set either globally or on a per printer basis. |
---|
704 | # Allowed values are 0 or any positive integer. |
---|
705 | # Default value is 0, which means that the banner won't be printed |
---|
706 | # at all if the user is forbidden to print. |
---|
707 | maxdenybanners: 0 |
---|
708 | |
---|
709 | # StartingBanner : if defined will print a banner before the rest of the job |
---|
710 | # is printed. The argument can be a printable file, or an executable file. |
---|
711 | # If not executable, the file will be printed as is. If executable, the |
---|
712 | # file will be executed and its output will be printed. |
---|
713 | # |
---|
714 | # NB : CUPS ONLY FOR NOW ! |
---|
715 | # |
---|
716 | # In any case, the banner content which will be sent to the printer |
---|
717 | # MUST be in a format your printer will accept !!! |
---|
718 | # |
---|
719 | # The pkbanner command included in PyKota can automatically generate |
---|
720 | # starting and ending banners in the PostScript format. You can use |
---|
721 | # this command in a pipe through GhostScript if your printer doesn't |
---|
722 | # accept PostScript as an input format. |
---|
723 | # NB : pkbanner's default page size is A4 |
---|
724 | # |
---|
725 | # startingbanner: /home/joe/mystaticbanner.ps |
---|
726 | # startingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com" |
---|
727 | # startingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono - |
---|
728 | # startingbanner: /usr/bin/pkbanner |
---|
729 | |
---|
730 | # EndingBanner : if defined will print a banner before the rest of the job |
---|
731 | # is printed. The argument can be a printable file, or an executable file. |
---|
732 | # If not executable, the file will be printed as is. If executable, the |
---|
733 | # file will be executed and its output will be printed. |
---|
734 | # |
---|
735 | # NB : CUPS ONLY FOR NOW ! |
---|
736 | # |
---|
737 | # In any case, the banner content which will be sent to the printer |
---|
738 | # MUST be in a format your printer will accept !!! |
---|
739 | # |
---|
740 | # The pkbanner command included in PyKota can automatically generate |
---|
741 | # starting and ending banners in the PostScript format. You can use |
---|
742 | # this command in a pipe through GhostScript if your printer doesn't |
---|
743 | # accept PostScript as an input format. |
---|
744 | # NB : pkbanner's default page size is A4 |
---|
745 | # |
---|
746 | # A static banner page |
---|
747 | # endingbanner: /home/joe/mystaticbanner.ps |
---|
748 | # |
---|
749 | # A banner with personnalized logo and url |
---|
750 | # endingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com" |
---|
751 | # |
---|
752 | # A banner in the format accepted by the printer |
---|
753 | # endingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono - |
---|
754 | # |
---|
755 | # A banner with more info on it, extracted from the yellow pages. |
---|
756 | # the string "Phone 111222333444" will be added to the banner page |
---|
757 | # if extractphone.sh returns 111222333444 for the current user. |
---|
758 | # endingbanner: /usr/bin/pkbanner Phone `extractphone.sh $PYKOTAUSERNAME` |
---|
759 | # |
---|
760 | # Default PyKota banner |
---|
761 | # endingbanner: /usr/bin/pkbanner |
---|
762 | |
---|
763 | # How should enforcement be done for this printer ? |
---|
764 | # |
---|
765 | # "laxist" is the default if value is not set, and allows users |
---|
766 | # to be over quota on their last job. |
---|
767 | # |
---|
768 | # "strict" tries to prevent users from ever being over quota. |
---|
769 | # |
---|
770 | # Enforcement can be defined either globally, per printer, |
---|
771 | # or both. If both are defined, the printer specific enforcement |
---|
772 | # setting has priority. |
---|
773 | # |
---|
774 | # valid values : "strict" or "laxist" |
---|
775 | # |
---|
776 | # default value |
---|
777 | # enforcement : laxist |
---|
778 | enforcement : strict |
---|
779 | |
---|
780 | # Should we trust the job size on this printer ? |
---|
781 | # |
---|
782 | # "trustjobsize : yes" is the default, the jobsize, either computed |
---|
783 | # by the hardware or by software is trusted. |
---|
784 | # |
---|
785 | # "trustjobsize : >N:precomputed" : uses the precomputed value if jobsize > N pages |
---|
786 | # "trustjobsize : >N:25" : uses 25 if jobsize is >N pages |
---|
787 | # |
---|
788 | # General form : ">n:m" where n is a positive integer, and m is |
---|
789 | # either the word 'precomputed' or a positive integer. |
---|
790 | # The special form "yes" is also accepted and is the default. |
---|
791 | # |
---|
792 | # This directive can be set either globally or on a per printer |
---|
793 | # basis. Use this directive when hardware accounting for a particular |
---|
794 | # printer produces some glitches due to the printer returning |
---|
795 | # incorrect answers. |
---|
796 | # |
---|
797 | # NB : DON'T MODIFY THIS IF YOU DON'T NEED TO. THIS IS ONLY TO BE USED |
---|
798 | # AS A WORKAROUND FOR SOME PRINTERS. IT'S PROBABLY BETTER TO ALWAYS |
---|
799 | # SET THIS DIRECTIVE TO 'yes'. THIS DIRECTIVE WILL ONLY BE HONORED |
---|
800 | # IF PYKOTA DETECTS A DIFFERENCE BETWEEN THE PRECOMPUTED JOB SIZE |
---|
801 | # AND THE JOB SIZE AS COMPUTED BY PYKOTA EITHER USING HARDWARE OR |
---|
802 | # SOFTWARE. |
---|
803 | trustjobsize : yes |
---|
804 | |
---|
805 | # Should we deny duplicate jobs ? |
---|
806 | # |
---|
807 | # A duplicate is a job sent twice (or more) in a row to the same printer |
---|
808 | # by the same user. |
---|
809 | # |
---|
810 | # This can be defined either globally or on a per printer basis |
---|
811 | # The default value is 'no', meaning that duplicate jobs are |
---|
812 | # allowed. |
---|
813 | # |
---|
814 | # NB : if an user prints a job, a second user prints another |
---|
815 | # job, and the first user prints the first job again, |
---|
816 | # this is NOT considered as a duplicate since the two |
---|
817 | # identical jobs printed by the first user are not |
---|
818 | # one just after the other. |
---|
819 | # |
---|
820 | # Possible values are 'yes' and 'no' |
---|
821 | # |
---|
822 | denyduplicates : no |
---|