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

Revision 3561, 53.8 kB (checked in by jerome, 11 years ago)

Changed copyright years.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
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# IMPORTANT : While printing, PyKota needs to retrieve some values from
29# the CUPS server it's installed on by doing unauthenticated requests
30# of the form http://localhost:631. Recent releases of CUPS have added
31# the possibility to hide some values like user's name for example for
32# privacy reasons, and this makes PyKota fail. Please ensure that the
33# cupsd.conf file contains the following directives :
34
35#     JobPrivateAccess all
36#     JobPrivateValues none
37#
38# This will ensure that PyKota can retrieve all the print job attributes it
39# needs to correctly function.
40#
41#
42# PyKota - Print Quotas for CUPS
43#
44# (c) 2003-2013 Jerome Alet <alet@librelogiciel.com>
45# This program is free software: you can redistribute it and/or modify
46# it under the terms of the GNU General Public License as published by
47# the Free Software Foundation, either version 3 of the License, or
48# (at your option) any later version.
49#
50# This program is distributed in the hope that it will be useful,
51# but WITHOUT ANY WARRANTY; without even the implied warranty of
52# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
53# GNU General Public License for more details.
54#
55# You should have received a copy of the GNU General Public License
56# along with this program.  If not, see <http://www.gnu.org/licenses/>.
57#
58# $Id$
59#
60
61
62#
63# All directives must be placed below the following line
64[global]
65
66# This directive configures the charset to use when reading PyKota's
67# configuration files. All directives values will be decoded and
68# interpreted using the character set defined here.
69# This value can only be present in the [global] section.
70#
71# When not set, the default value 'UTF-8' is used.
72config_charset : UTF-8
73
74####################################################################
75# SQLite3 : comment this section out if you use another backend    #
76####################################################################
77
78#storagebackend : sqlitestorage
79#storagename: /etc/pykota/pykota.db
80
81####################################################################
82
83
84
85############################################################################
86# PostgreSQL or MySQL: comment this section out if you use another backend #
87############################################################################
88storagebackend: pgstorage
89# storagebackend: mysqlstorage
90
91# Quota Storage Server hostname (and optional port)
92# e.g. db.example.com:5432 (for PostgreSQL) or db.example.com:3306 (for MySQL)
93# NB : leave the directive empty to use unix sockets (same host only)
94# NB : Using the word 'localhost' for MySQL defaults to a UNIX socket
95#      connection, which may be unexpected. Using 127.0.0.1 avoids this issue.
96#      See http://bugs.mysql.com/bug.php?id=31577 for more information.
97storageserver: 127.0.0.1
98
99#
100# name of the Quota Storage Database
101storagename: pykota
102
103#
104# Quota Storage normal user's name and password
105# These two fields contain a username and optional password
106# which may give readonly access to your print quota database.
107#
108# PLEASE ENSURE THAT THIS USER CAN'T WRITE TO YOUR PRINT QUOTA
109# DATABASE, OTHERWISE ANY USER WHO COULD READ THIS CONFIGURATION
110# FILE COULD CHANGE HIS PRINT QUOTA.
111#
112storageuser : pykotauser
113# In the line below change the password's value if needed.
114storageuserpw : readonlypw
115
116############################################################################
117
118
119
120####################################################################
121# LDAP : comment this section out if you use another backend       #
122####################################################################
123# LDAP example, uncomment and adapt it to your own configuration :
124#
125#storagebackend: ldapstorage
126#storageserver: ldap://ldap.example.com:389
127#storagename: dc=example,dc=com
128#
129# NB : the user and password below are the ones contained in
130# the sample LDIF file pykota/initscripts/ldap/pykota-sample.ldif
131# Please adapt these lines to your own needs.
132#
133#storageuser: cn=pykotauser,dc=example,dc=com
134#storageuserpw: ls88DT5j
135
136
137
138# TLS support for LDAP
139#
140# ldaptls can be set to either Yes or No
141# the default value when not set is No, meaning that TLS won't be used.
142#
143#ldaptls: No
144#
145# cacert points to the CA Certificate file to use for TLS.
146# Ensure that every user who can launch PyKota commands can read this file.
147# There's NO default value for this directive.
148#
149#cacert: /etc/pykota/mycertfile
150
151
152
153# Here we define some helpers to know where
154# to plug into an existing LDAP directory
155# NB : THE DIRECTIVES BELOW MUST BE PRESENT WITH AN LDAP BACKEND
156# BUT YOU ARE FREE TO CHANGE THE VALUES.
157#
158#userbase: ou=People,dc=example,dc=com
159#userrdn: uid
160#balancebase: ou=People,dc=example,dc=com
161#balancerdn: uid
162#groupbase: ou=Groups,dc=example,dc=com
163#grouprdn: cn
164#printerbase: ou=Printers,ou=PyKota,dc=example,dc=com
165#printerrdn: cn
166#jobbase: ou=Jobs,ou=PyKota,dc=example,dc=com
167#lastjobbase: ou=LastJobs,ou=PyKota,dc=example,dc=com
168#billingcodebase: ou=BillingCodes,ou=PyKota,dc=example,dc=com
169
170# These two fields are special, they either accept a branch
171# dn, like an ou for example, or the special keywords 'user'
172# and 'group'. If 'user' or 'group' is used, the print quota
173# entries will be created below the user or group entry itself,
174# which will then be used like a branch (you can mix and match
175# different values depending on what you want to do).
176#
177# NB : YOU MUST CHOOSE A VALUE FOR USERQUOTABASE AND A VALUE
178# FOR GROUPQUOTABASE, BUT ONLY ONE LINE OF EACH MUST BE PRESENT.
179#userquotabase: user
180#userquotabase: ou=UQuotas,ou=PyKota,dc=example,dc=com
181#groupquotabase: group
182#groupquotabase: ou=GQuotas,ou=PyKota,dc=example,dc=com
183
184
185
186# How to create new accounts and groups
187# authorized values are "below" and "attach(objectclass name [, fail|warn])"
188#
189# "below" creates the new accounts/groups as standalone entries
190# below the above defined 'userbase' ou
191#
192# attach(objectclass name [, action]) tries to find some existing user/group
193# using the above defined 'userrdn' or 'grouprdn' and 'userbase'
194# 'groupbase', and attach the PyKota specific entries to it.
195# if action is "warn" and no entry exists to attach to, a new
196# entry is created, and a message is logged.
197# if action is "fail" and no entry exists to attach to, program
198# logs an error message and aborts.
199# if action is not set, the default value is "fail".
200#
201# a possible value:  newuser: attach(posixAccount, warn)
202#
203#newuser : below
204#newgroup : below
205
206
207
208# LDAP attribute which stores the user's email address
209#
210#usermail : mail
211
212
213
214# Choose what attribute contains the list of group members
215# common values are : memberUid, uniqueMember, member
216#
217#groupmembers: memberUid
218
219
220
221# Activate low-level LDAP cache yes/no
222# Nothing to do with "storagecaching" which is higher level
223# and database independant.
224# This saves some search queries and may help with heavily
225# loaded LDAP servers.
226# This is EXPERIMENTAL.
227#
228# BEWARE : SETTING THIS TO 'YES' CAUSES PROBLEMS FOR NOW
229# BETTER TO LET IT SET TO 'NO'
230#
231# ldapcache: no
232
233####################################################################
234
235#############################################################
236# END of database specific directives                       #
237#############################################################
238
239
240
241# Should the database caching mechanism be enabled or not ?
242# If unset, caching is disabled. Possible values Y/N/YES/NO
243# caching mechanism works with both relationnal and OpenLDAP backends
244# but may be really interesting only with OpenLDAP.
245#
246# ACTIVATING CACHE MAY CAUSE PRECISION PROBLEMS IN PRINT ACCOUNTING
247# IF AN USER PRINTS ON SEVERAL PRINTERS AT THE SAME TIME.
248# YOU MAY FIND IT INTERESTING ANYWAY, ESPECIALLY FOR LDAP.
249#
250# THERE'S NO GUARANTEE THAT THIS CACHING MECHANISM WILL IMPROVE
251# PERFORMANCE WITH RELATIONNAL BACKENDS. IT MIGHT EVEN MAKE
252# PERFORMANCE DECREASE. AS ALWAYS : YMMV.
253#
254# FYI, I ALWAYS SET IT TO YES !
255#
256storagecaching: No
257
258
259
260# Should full job history be disabled ?
261# If unset or set to No, full job history is kept in the database.
262# Disabling the job history can be useful with heavily loaded
263# LDAP servers, to not make the LDAP tree grow out of control.
264# Disabling the job history with a relationnal backend works too
265# but it's probably less useful than with LDAP.
266#
267disablehistory: No
268
269
270
271# Where to log ?
272# supported values : stderr, system (system means syslog, but don't use
273# 'syslog' here). if the value is not set then the default SYSTEM applies.
274#
275logger: system
276
277
278
279# Enable debugging ? Put YES or NO there.
280# debug is set to YES in this sample configuration file, so debugging
281# is activated when configuring PyKota, which helps a lot. After all
282# works, just put NO instead to save some disk space in your logs.
283# NB : When set to YES, there is a very significant impact on performance
284# when managing many users, printers or billing codes at once, because
285# hundreds of thousands of log lines can be generated.
286# When printing a job, typically around 250-300 log lines are generated,
287# so the impact per job is really minimal. Note however that this will
288# add up over a large number of jobs.
289#
290debug : Yes
291
292
293
294# The URL to PyKota's logo when used from the CGI scripts.
295# You can use your own logo by modifying the URL below.
296# If not defined, the default URL is the same as the
297# one defined below :
298#
299logourl : http://www.pykota.com/pykota.png
300
301
302
303# The destination to which the web browser will be redirected
304# when you click on the logo defined above.
305# If not defined, the default URL is the same as the
306# one defined below :
307#
308logolink : http://www.pykota.com/
309
310
311
312# Mail server to use to warn users
313# If the value is not set then localhost is used.
314#
315smtpserver: localhost
316
317
318
319# Crash messages' recipient : in addition to the log files
320# each software crash can be sent to the author of PyKota
321# or any other person of your choice. By default this
322# is disabled for privacy concerns (see below). The address
323# pykotacrashed@librelogiciel.com reaches PyKota's author.
324# The 'adminmail' (defined a bit below) is CCed.
325#
326# Privacy concerns : what is sent is only :
327#
328#        - a copy of the software's traceback
329#        - a copy of the software's command line arguments
330#        - a copy of the software's environment variables
331#
332# suggested value :
333#
334# crashrecipient: pykotacrashed@librelogiciel.com
335
336
337
338# Email domain
339# If the value is not set, and the mail attribute for the user
340# is not set in the PyKota storage, be it LDAP (see usermail directive
341# above) or a relationnal one, then email messages are sent to
342# username@smtpserver
343#
344# If the value is set, then email messages are sent to
345# username@maildomain using the SMTP server defined above
346#
347# Set the appropriate value below, example.com set as per RFC2606.
348#
349maildomain: example.com
350
351
352
353# Should we modify usernames when printing ?
354# Default is native, meaning usernames won't be modified.
355# This is a [global] option only.
356# Some people reported that WinXP sends mixed case usernames,
357# setting usernamecase to 'upper' or 'lower' solves the problem.
358# Of course you have to use uppercase or lowercase only when managing
359# users with pkusers, because ALL database accesses are
360# still case sensitive.
361#
362# If usernamecase is 'upper' or 'lower', the usernames received
363# from the printing system are converted to uppercase or lowercase,
364# respectively, at the start of printing, BUT ONLY when printing.
365#
366# If usernamecase is 'native', which is the default, strict case checking
367# is done, this means that users 'Jerome' and 'jerome' are
368# different. Printer and groups names are ALWAYS case sensitive.
369#
370# usernamecase : upper
371# usernamecase : lower
372usernamecase: native
373
374
375
376# Should we split usernames on a specific separator when printing ?
377# Default is No, i.e. if the value is unset.
378# This is a [global] option only.
379# This option adds support for Samba's Winbind utility, which
380# prefixes usernames with domain name and separator character.
381# Of course if you set this then you have to use NO separator when
382# adding users with edpykota.
383#
384# If winbind_separator is set, the usernames received from the printing
385# system are split on the separator's value, and only the last part
386# (real username) is used.
387#
388# If winbind_separator is not set, which is the default, strict
389# username equality checking will be done (modulo the setting
390# of the 'usernamecase' directive), this means that users 'DOMAIN1/jerome',
391# 'Domain2/jerome' and 'jerome' are different.
392#
393# winbind_separator: /
394
395
396
397# When creating users or groups accounts, should we reject users
398# or groups which are unknown from the system ?
399# The default if unset is NO. This means that by default, you
400# can create users or groups for which `getent passwd username`
401# or `getent group groupname` returns nothing.
402#
403# Allowed values : Yes | No
404# Default value : No
405#
406# reject_unknown: No
407
408
409
410# Do we want to hide jobs' title, filename and options for privacy
411# reasons ?
412# This may be required in some countries (Italy comes to mind).
413# Allowed values are YES and NO.
414# If unset, the default value is NO, meaning that jobs' title, filename
415# and options will be saved into the history.
416# This option can't be set on a per printer basis, only into the
417# [global] section.
418#
419privacy : no
420
421
422
423# When the real CUPS backend fail, should we modify the
424# user's page counters and account balance or not ?
425# Also should we retry and if yes then how often and how many times ?
426# If you trust your users, set it to "nocharge".
427# If you think they found some mean to kill the real CUPS backend,
428# then set it to "charge".
429# If your print queues get regularly disabled by CUPS when the printers
430# are switched off, you might want to set it to "retry:N:S" where
431# N is the number of times the operation should be retried, and S is
432# the delay in seconds during which PyKota will sleep before trying again.
433# This 'retry' feature works in a way similar to Till Kamppeter's beh
434# backend wrapper which offers this functionnality but is actually not
435# compatible with PyKota (because of my own inability to master regular
436# expressions).
437# If N is 0, PyKota will retry indefinitely each S seconds until the
438# backend succeeds, so you should use this with caution. If N is 0,
439# of course neither "charge" nor "nocharge" will be honored.
440# You can combine "charge" or "nocharge" with "retry:N:S" if you want,
441# by separating the values with a comma as shown in the examples below.
442# If unset, the default value is "nocharge", meaning that users won't be
443# charged whenever a CUPS backend fails. This is the OPPOSITE
444# behavior compared to PyKota versions prior to 1.24alpha2.
445# This value can be set either globally or on a per printer basis
446# If both are defined, the printer option has priority.
447#
448# onbackenderror : charge,retry:5:60
449# onbackenderror : retry:0:300
450# onbackenderror : retry:3:300,nocharge
451# onbackenderror : charge
452onbackenderror : nocharge
453
454
455
456# Should we strip off some characters from the beginning of
457# print jobs' titles ? This can be used to remove smbprn.??????
458# which sometimes appear when printing in raw mode from Windows
459# through Samba.
460# This setting only applies at printing time.
461# When not set, titles are used as received from the printing system.
462# The default is to not strip any character off of jobs' titles.
463# This value can be set either globally or on a per printer basis
464# If both are defined, the printer option has priority.
465#
466# striptitle : smbprn.??????
467
468
469
470# Should we launch a command to overwrite the job's ticket ?
471# This allows a command to overwrite the username and/or the
472# billing code used, or to deny or cancel the job.
473# If unset no command is launched and the job's username and
474# billing code are used as they are received.
475# To overwrite the job's ticket, the command has to print
476# on its standard output one or more of the following lines,
477# without any prefix or space character :
478#
479#    USERNAME=the_username_we_want_to_overwrite_with
480#    BILLINGCODE=the_billingcode_we_want_to_overwrite_with
481#    REASON=reason_we_chose_deny_or_cancel
482#    AUTH=NO (equivalent to DENY below)
483#    DENY
484#    CANCEL
485#
486# NB : the output of your command is entirely read, and the latest
487# value seen is used, so you command can output several usernames
488# or billing codes and only the latest ones will be used.
489# If only USERNAME= lines are printed, the billing code,
490# if any, is used unchanged.
491# If only BILLINGCODE= lines are printed, the username is
492# used unchanged.
493# If DENY or CANCEL is output, neither the username nor the
494# billing code can be overwritten.
495# If REASON is output, that will be used in the notification in the case of
496# DENY or CANCEL. Otherwise, the built-in reasons will be used.
497#
498# This value can be set either globally or on a per printer basis
499# If both are defined, the printer option has priority.
500#
501# IMPORTANT :
502#
503#       If you use this directive to interact with the end user in
504#       some way, for example through pknotify+pykoticon or similar
505#       tools, you have to keep in mind that this directive, as all
506#       the directives in pykota*.conf, is processed at the time
507#       the print job reaches the top of the print queue, and not
508#       at the time it enters the print queue. For heavily loaded
509#       systems where several jobs are in the print queue at a given
510#       time, there may be a significant delay between the moment the
511#       user submits the print job, and the moment this directive is
512#       processed.
513#
514# examples :
515#
516# overwrite_jobticket : /usr/bin/pknotify --destination $PYKOTAJOBORIGINATINGHOSTNAME:7654 --timeout 180 --denyafter 3 --checkauth --ask "Username:username:$PYKOTAUSERNAME" "Password:password:" "Billing code:billingcode:$PYKOTAJOBBILLING"
517# overwrite_jobticket : /path/to/some/script/or/command
518
519
520
521# Should we ask the end user for a confirmation about their print job ?
522#
523# Any script can be launched here. If your script prints CANCEL on
524# its standard output, the job is cancelled, else processing of the
525# job continues to next step.
526#
527# NB : the output of your command is read until CANCEL is found
528# or all lines have been read.
529#
530# This value can be set either globally or on a per printer basis
531# If both are defined, the printer option has priority.
532#
533# examples :
534#
535# askconfirmation : /usr/bin/pknotify --destination $PYKOTAJOBORIGINATINGHOSTNAME:7654 --timeout 120 --confirm "Hello $PYKOTAUSERNAME.\nPrint job $PYKOTAJOBID send to printer $PYKOTAPRINTERNAME is $PYKOTAPRECOMPUTEDJOBSIZE pages long\nand will cost you $PYKOTAPRECOMPUTEDJOBPRICE credits.\n\nYou currently have $PYKOTABALANCE credits.\n\nDo you really want to print ?"
536
537
538
539# What should we do when we print and the billing code used is
540# not present in the database ?
541# The default value is 'create' which adds the billing code to the
542# database.
543# Other values can be :
544#       deny
545#     which silently rejects the job.
546# or :
547#       deny(your script here)
548#     if you put the path to a script or command here, it is executed, for
549#     example you can open a popup window explaining why the job was
550#     rejected.
551#
552# This value can be set either globally or on a per printer basis
553# If both are defined, the printer option has priority.
554#
555# unknown_billingcode : deny
556# unknown_billingcode : deny(/usr/bin/pknotify --destination $PYKOTAJOBORIGINATINGHOSTNAME:7654 --timeout 60 --notify "The billing code specified is not allowed")
557# unknown_billingcode : deny(/path/to/some/script)
558# unknown_billingcode : create
559
560
561
562# Where should we store our (temporary) files when printing ?
563# if unset, defaults to a system directory dedicated to temporary
564# files and evaluated at runtime (see Python's documentation
565# for the tempfile.gettempdir() function).
566# This value can be set either globally or on a per printer basis
567# If both are defined, the printer option has priority.
568# On my system, when not set, the /var/spool/cups/tmp directory is used.
569# directory : /tmp
570# directory : /var/spool/cups
571
572
573
574# Should we keep our work files on disk after printing ?
575# If unset, temporary files are deleted once the work is finished.
576# If set to yes, files are kept on disk in the 'directory'
577# named with the previous directive.
578# This value can be set either globally or on a per printer basis
579# If both are defined, the printer option has priority.
580# Default value is No, meaning temporary files are deleted
581# You should set it to yes only during installation to not
582# waste disk space during normal use.
583#
584# keepfiles : yes
585keepfiles : no
586
587
588
589# What is the accounting backend to use : this defines the way PyKota
590# will compute the number of pages printed. This directive is the most
591# important one in PyKota's configuration.
592#
593# NB : This directive is MANDATORY, there's no default value when not set.
594#
595# Supported values :
596#
597# - software([/path/to/some/script[ --with-args]])
598# - hardware(snmp[:community]|pjl[:port]|/path/to/some/script[ --with-args])
599#
600# Hardware asks the printer for its lifetime page counter through either
601# SNMP, PJL-over-TCP, or through any command of your choice. This is
602# the recommended way to use PyKota, although it might not work with some
603# printers. The page counter is asked twice per job : before the job
604# is sent to the printer, and after it has been entirely sent.
605# The big advantages of hardware accounting are lighter CPU usage compared
606# to software accounting described below, although it can take more time
607# because of necessary internal counter stabilization delays, and the fact
608# that paper jams don't cause users to be charged for pages they couldn't
609# print.
610# For hardware accounting, two special values are accepted in addition
611# to a script name : snmp and pjl. 'snmp' asks PyKota to use its internal
612# SNMP code, 'pjl' asks PyKota to internally send a specially crafter PJL
613# job to the printer's TCP port 9100 (by default).
614#
615# Software counts pages by parsing the print job's datas, either internally
616# when no script is specified, or through any script of your choice.
617# This works with ALL printers, provided you've got a script to parse
618# datas produced by your printer driver. PyKota's internal parser, also
619# available under the name 'pkpgcounter', recognizes several page description
620# languages, but may occasionally fail for some printer drivers.
621# You can however use any other command, provided it can read the datas to
622# parse from the file pointed to by the PYKOTADATAFILE environment
623# variable, and prints a single integer on its standard
624# output, representing the number of pages in the print job.
625# Software accounting unfortunately may overcharge users in case of paper
626# jams.
627#
628# Ink computes the price of a print job by parsing the job's datas
629# through pkpgcounter, and using the percents of ink coverage returned
630# for each color in the specified colorspace.
631
632# Supported colorspaces for ink accounting currently are :
633#
634#       bw      ===> Black & White
635#       cmyk    ===> Cyan, Magenta, Yellow, Black
636#       cmy     ===> Cyan, Magenta, Yellow
637#       rgb     ===> Red, Green, Blue
638#       gc      ===> Grayscale, Colored : this is a pseudo colorspace useful
639#                    if all you need is differentiating grayscale from
640#                    colored pages.
641#
642# Supported resolutions for ink accounting are any number of dots
643# per inch comprised between 72 and 1200.
644# IMPORTANT : increasing the resolution increases precision, but
645# increase CPU load a lot at the same time. The default resolution
646# if unset is 72, for 72 dpi.
647# If you want to use ink accounting, you have to define a set of
648# coefficients for each color in the colorspace, as explained
649# further below in this file.
650#
651# You can get hints on which configuration is best for your printers by
652# typing : pkturnkey --doconf
653#
654# In the lines below "%(printer)s" is automatically replaced at run time
655# with your printer's Fully Qualified Domain Name for network printers,
656# if PyKota can extract it from its environment.
657#
658# Examples :
659#
660# accounter : hardware(snmp)
661# accounter : hardware(snmp:private)
662# accounter : hardware(pjl)
663# accounter : hardware(pjl:9101)
664# 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 " ")
665# accounter : hardware(/usr/bin/npadmin --pagecount %(printer)s)
666# 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)
667# accounter : hardware(/bin/cat /usr/share/pykota/pagecount.pjl >/dev/lp0 && /usr/bin/head -2 </dev/lp0 | /usr/bin/tail -1)
668# 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)
669# 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)
670# accounter : software(/usr/bin/pkpgcounter "$PYKOTADATAFILE")
671# accounter : software()
672# accounter : ink(cmyk, 150)
673# accounter : ink(bw, 300)
674# accounter : ink(bw)
675# accounter : ink(cmy, 72)
676# accounter : ink(gc, 72)
677#
678# This directive can be set either globally or per printer or both.
679# If both are defined, the printer option has priority.
680#
681# IF YOU PLAN TO USE YOUR OWN SCRIPTS FOR HARDWARE ACCOUNTING,
682# YOU ABSOLUTELY HAVE TO BE SURE YOU HAVE A SCRIPT WHICH WAITS FOR THE
683# PRINTER BEING READY BEFORE ASKING FOR ITS INTERNAL PAGE COUNTER.
684#
685# PYKOTA'S 'snmp' and 'pjl' HARDWARE ACCOUNTING METHODS DO THE CORRECT WORK
686# INTERNALLY, BUT SOME OF THE EXAMPLES ABOVE DON'T, YOU HAVE BEEN WARNED.
687#
688# WITH THE SPECIAL MAGIC hardware(snmp) AND hardware(pjl) VALUES, PYKOTA
689# TAKES CARE OF ALL THIS FOR YOU, SO PLEASE UNDERSTAND THAT IT IS PREFERABLE
690# TO USE THESE TWO METHODS : THEY WORK FINE, REQUIRE LITTLE TO NO CPU,
691# AND DO ALL THE HARD WORK AUTOMATICALLY. IF YOU REALLY NEED TO YOU CAN USE
692# YOUR OWN EXTERNAL COMMANDS AS DESCRIBED ABOVE, JUST BE CAREFUL WITH THIS.
693#
694# Sane default :
695#
696accounter: software()
697
698# Should we ensure that the printer really is idle before
699# sending the job's datas to it ?
700#
701# This directive is only used when you use an internal
702# hardware accounting mechanism, like hardware(snmp) or
703# hardware(pjl), and is not used for external hardware
704# accounting mechanisms or for software or ink accounting.
705#
706# If PyKota and CUPS are properly configured, i.e. a single
707# computer (the print server) can access to a particular physical
708# printer, or all CUPS+PyKota print servers which access to the
709# same physical printer share a common network directory used
710# by PyKota to lock this printer resource, then it is not necessary
711# to really ensure the printer is idle before the job, because
712# this is already the case : we already wait at the end of the
713# preceding job for the printer to be idle before reading its
714# internal page counter. So setting this value to Yes usually
715# saves a lot of time between jobs, generally around 30 seconds.
716#
717# If you're not sure, leave this value to the default which is No,
718# meaning that before sending the job's datas to the printer, PyKota
719# will ensure this printer is in idle state.
720#
721# If not defined, a value of No is assumed.
722#
723# This value can be set either globally or on a per printer basis
724# If both are defined, the printer option has priority.
725#
726# Sane default :
727#
728skipinitialwait : no
729
730# What is the "pre"-accounter used for precomputing the job's size.
731#
732# Supported values are :
733#
734#  preaccounter: software()
735#  preaccounter: software(/path/to/your/script)
736#  preaccounter: ink(colorspace, resolution)
737#
738# NB : the preaccounter directive doesn't support hardware() for obvious
739# reasons. If unset, "software()" is assumed. If you use your own script,
740# ensure that it only prints the job's number of pages (or an estimation
741# of it) on its standard output, and that it reads the print job's datas
742# from the file pointed to by the PYKOTADATAFILE environment variable.
743#
744# You may want to define for example 'preaccounter : software(/bin/echo 1)'
745# in the case your printer supports an hardware accounter but pkpgcounter
746# can't parse your printer driver's datas.
747#
748# Supported colorspaces for ink accounting currently are :
749#
750#       bw      ===> Black & White
751#       cmyk    ===> Cyan, Magenta, Yellow, Black
752#       cmy     ===> Cyan, Magenta, Yellow
753#       rgb     ===> Red, Green, Blue
754#       gc      ===> Grayscale, Colored : this is a pseudo colorspace useful
755#                    if all you need is differentiating grayscale from
756#                    colored pages.
757#
758# Supported resolutions for ink accounting are any number of dots
759# per inch comprised between 72 and 1200.
760# IMPORTANT : increasing the resolution increases precision, but
761# increase CPU load a lot at the same time. The default resolution
762# if unset is 72, for 72 dpi.
763#
764# This value can be set either globally or on a per printer basis
765# If both are defined, the printer option has priority.
766#
767# Sane default :
768#
769preaccounter: software()
770
771
772
773# What should we do if the accounter's subprocess doesn't return
774# a valid result (for example doesn't return an integer on its stdout)
775#
776# Valid values are : 'continue' and 'stop'. 'stop' is the default
777# if unset.
778#
779# 'continue' means try to process as usual, this may introduce
780# accounting errors and free jobs. This was the default behavior
781# until v1.20alpha5.
782#
783# 'stop' means fail and stop the print queue. If an accounter
784# error occurs, most of the time this is a misconfiguration, so
785# stopping the print queue is usually the best thing to do
786# until the admin has fixed the configuration.
787#
788# This value can be set either globally or on a per printer basis
789# If both are defined, the printer option has priority.
790#
791# NB : This directive shouldn't do much now because in case
792# of external accounter error, PyKota just loops.
793#
794# onaccountererror: continue
795onaccountererror: stop
796
797
798
799# Print Quota administrator
800# These values can be set either globally or per printer or both.
801# If both are defined, the printer option has priority.
802# If these values are not set, the default admin root
803# and the default adminmail root@localhost are used.
804admin: John Doe
805adminmail: root@localhost
806
807
808
809# Who should we send an email to in case a quota is reached ?
810# possible values are : DevNull, User, Admin, Both, External(some command)
811# The Both value means that the User and the Admin will receive
812# an email message.
813# The DevNull value means no email message will be sent.
814# This value can be set either globally or per printer or both.
815# If both are defined, the printer option has priority.
816# If the value is not set, then the default BOTH applies.
817#
818#   Format of the external syntax :
819#
820#       mailto: external(/usr/bin/mycommand >/dev/null)
821#
822#   You can use :
823#
824#       '%(action)s'            will contain either WARN or DENY
825#       '%(username)s'          will contain the user's name
826#       '%(printername)s'       will contain the printer's name
827#       '%(email)s'             will contain the user's email address
828#       '%(message)s'           will contain the message if you want
829#                               to use it.
830#
831#   on your command line, to pass arguments to your command.
832#   Examples :
833#
834#     mailto: external(/usr/bin/callpager %(username)s "Quota problem on %(printername)s" >/dev/null)
835#
836#   To automatically send a WinPopup message (this may only work with a PDC,
837#   here the same machine does Samba as PDC + CUPS) :
838#
839#     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)
840#
841#   NB : I use ISO-8859-15, but Windows expects UTF-8, so we pipe the message
842#        into iconv before sending it to the Windows user.
843#
844# or more simply :
845#
846#     mailto: external(/usr/share/pykota/mailandpopup.sh %(username)s %(printername)s "%(email)s" "%(message)s" 2>&1 >/dev/null)
847#
848#   NB : The mailandpopup.sh shell script is now included in PyKota
849#
850#   NB : in ANY case, don't forget to redirect your command's standard output
851#        somewhere (e.g. >/dev/null) so that there's no perturbation to the
852#        underlying layer (filter or backend)
853#
854mailto : both
855
856
857
858# The value of the zero for account balance limitations.
859# If a user is limited by balance, he can print until
860# his balance reaches the value defined here. If unset,
861# the default value is 0. Any floating point value
862# is accepted.
863# You'll want to use this to give free credits to your users
864# at the start of the year for example.
865#
866# This option can only appear in the global section
867#
868# balancezero : -0.25
869#
870balancezero: 0.0
871
872
873
874# Grace delay in days
875# This value can be set either globally or per printer or both.
876# If both are defined, the printer option has priority.
877# If the value is not set then the default seven (7) days applies.
878#
879gracedelay : 7
880
881
882
883# Poor man's threshold
884# If account balance reaches below this amount, a warning message
885# is sent through the 'mailto' directive above.
886#
887# If unset, default poor man's threshold is 1.0.
888# This option can only appear in the global section
889#
890poorman : 1.0
891
892
893
894# Poor man's warning message
895# The warning message that is sent if the "poorman" value is reached
896# Again this must appear in the global section
897#
898poorwarn : Your Print Quota account balance is low.
899 Soon you'll not be allowed to print anymore.
900
901
902
903# Soft limit reached warning message
904# The warning message that is sent if the soft quota limit is reached
905# May appear either globally or on a per-printer basis
906#
907softwarn: Your Print Quota Soft Limit is reached.
908 This means that you may still be allowed to print for some
909 time, but you must contact your administrator to purchase
910 more print quota.
911
912
913
914# Hard limit reached error message
915# The error message that is sent if the hard quota limit is reached
916# May appear either globally or on a per-printer basis
917#
918hardwarn: Your Print Quota Hard Limit is reached.
919 This means that you are not allowed to print anymore.
920 Please contact your administrator at root@localhost
921 as soon as possible to solve the problem.
922
923
924
925# Default policy to apply when either :
926#
927#       - Printer doesn't exist in PyKota's database
928#       - User doesn't exist in PyKota's database
929#       - User has no quota entry for this Printer in PyKota's database
930#
931# Value can be either 'allow' or 'deny' or 'external(some command here)'
932#
933# 'Allow' means that the job will be printed even if the printer, the
934# user or this user's print quota entry on this printer doesn't exist
935# in PyKota's database. But the job won't appear in the printing history.
936#
937# 'Deny' means the job will be rejected if any of these three conditions
938# is met.
939#
940# 'External' means any command of your choice will be launched if any
941# of these three conditions is met. Once your command has ended, PyKota
942# will try again to retrieve the printer, user or user's print quota
943# entry from its database. If it fails to find any of them again, the
944# job will be rejected.
945#
946# This value can be set either globally or per printer or both.
947# If both are defined, the printer option has priority.
948# If the value is not set then the default policy DENY applies.
949# There's no policy wrt inexistant groups, they are ignored.
950#
951# external policy can be used to launch any external command of your choice,
952# for example to automatically add the user to the quota database, and set
953# page limits on the current printer if he is unknown :
954#
955#   policy: external(/usr/bin/pkusers --add --skipexisting %(username)s && /usr/bin/edpykota --add --skipexisting --printer %(printername)s --softlimit 50 --hardlimit 60 %(username)s)
956#
957# NB : If you want to limit users by their account balance value, it is preferable to
958# use the following policy to automate user account creation on first print :
959#
960#   policy: external(/usr/bin/autopykota --initbalance 25.0)
961#
962#   This will automatically add the user if he doesn't already exist, and
963#   set his initial balance value to 25.0 (for example). If the user already
964#   exists then his balance value will not be modified.
965#   Please don't use autopykota if you want to limit your users by page
966#   quota, and in any case, carefully read autopykota's help or manpage
967#   and understand its goal before using it in your own configuration.
968#
969# Of course you can launch any command of your choice with this, e.g. :
970#
971#   policy: external(/usr/local/bin/myadminscript.sh %(username)s)
972#
973# You can use :
974#
975#       '%(username)s'          will contain the user's name
976#       '%(printername)s'       will contain the printer's name
977#
978#   On your command line, to pass arguments to your command.
979#
980# If the printer, user, or user quota entry still doesn't exist after
981# external policy command was launched (the external command didn't add it),
982# or if an error occured during the execution of the external policy
983# command, then the job is rejected.
984#
985# By default, we reject all jobs from users not in the database :
986#
987policy: deny
988
989
990
991# Pre and Post Hooks
992# These directives allow the easy plug-in of any command of your choice
993# at different phases of PyKota's execution.
994# Pre and Post Hooks can access some of PyKota's internal information
995# by reading environment variables as described below.
996# The actual phase of PyKota's execution is available in the
997# PYKOTAPHASE environment variable.
998# Pre and Post Hooks can be defined either globally, per printer,
999# or both. If both are defined, the printer specific hook has
1000# priority.
1001#
1002# List of available environment variables :
1003# NB : Most of these variables are also available during the execution
1004# of external commands defined in the accounter and mailto
1005# directives.
1006#
1007# PYKOTADIRECTORY : The directory containing cupspykota's temporary files
1008# PYKOTADATAFILE : The name of the temporary file which contains the
1009#                  job's datas
1010# PYKOTAFILENAME : The name of the file which contains the job's datas or
1011#                  empty if datas come from stdin
1012# PYKOTAMD5SUM : Contains an hexadecimal digest of the md5 sum of the job's datas
1013# PYKOTAPHASE : BEFORE or AFTER the job is sent to the printer
1014# PYKOTAACTION : ALLOW or DENY or WARN for current print job
1015# PYKOTAUSERNAME : user's name, possibly modified through the overwrite_jobticket directive.
1016# PYKOTAORIGINALUSERNAME : user's name, unmodified.
1017# PYKOTAPRINTERNAME : printer's name
1018# PYKOTAPGROUPS : list of printers groups the current printer is a member of
1019# PYKOTAJOBID : job's id
1020# PYKOTATITLE : job's title
1021# PYKOTACOPIES : number of copies
1022# PYKOTAOPTIONS : job's options
1023# PYKOTABALANCE : user's account balance
1024# PYKOTALIFETIMEPAID : user's grand total paid
1025# PYKOTALIMITBY : user print limiting factor, for example 'quota' or 'balance'
1026# PYKOTAPAGECOUNTER : user's page counter on this printer
1027# PYKOTALIFEPAGECOUNTER : user's life time page counter on this printer
1028# PYKOTASOFTLIMIT : user's soft page limit on this printer
1029# PYKOTAHARDLIMIT : user's hard page limit on this printer
1030# PYKOTADATELIMIT : user's soft to hard limit date limit on this printer
1031# PYKOTAMAXJOBSIZE : the useers's maximal job size allowed on this printer
1032# PYKOTASTATUS : contains "CANCELLED" when SIGTERM was received by PyKota
1033#                else is not set.
1034# PYKOTAJOBSIZEBYTES : contains the job's size in bytes. Always available.
1035# PYKOTAPRECOMPUTEDJOBSIZE : contains the precomputed job's size
1036# PYKOTAPRECOMPUTEDJOBPRICE : contains the precomputed job's price
1037# PYKOTAJOBORIGINATINGHOSTNAME : contains the client's hostname if
1038#                                it is possible to retrieve it.
1039# PYKOTAPRINTERHOSTNAME : the printer's hostname or IP address for network
1040#                         printers, or "localhost" if not defined or not
1041#                         meaningful.
1042# PYKOTAWARNCOUNT : the number of times the user was forbidden to print but a banner
1043#                   page was still printed on the current printer.
1044# PYKOTAOVERCHARGE : user's overcharging factor.
1045# PYKOTAJOBBILLING : Job's billing code if present, possibly modified through the overwrite_jobticket directive.
1046# PYKOTAORIGINALJOBBILLING : Job's billing code if present, unmodified.
1047# PYKOTAREASON : if the job was denied or a warning needs to be issued, contains
1048#                the message to send to the user.
1049# PYKOTAUSERDESCRIPTION : the user's textual description
1050# PYKOTAPRINTERDESCRIPTION : the printer's textual description
1051# PYKOTAPRINTERPASSTHROUGHMODE : the printer's passthrough mode
1052# PYKOTAPRINTERMAXJOBSIZE : the printer's maximal job size
1053# PYKOTAPRICEPERJOB : the printer's price per job
1054# PYKOTAPRICEPERPAGE : the printer's price per page
1055#
1056
1057
1058# PreHook : gets executed after being sure the user, printer and user quota
1059# entry on the printer both exist in the PyKota database, and after
1060# checking if the user is allowed to print or not, but just before
1061# the job is sent to the printer (if allowed)
1062# prehook has access to many environment variables :
1063#
1064# PYKOTAACTION contains either "ALLOW", "WARN" or "DENY" and
1065# represents the action which is to be done wrt the print job.
1066# PYKOTAPHASE contains 'BEFORE' during execution of prehook
1067#
1068# uncomment the line below to see what environment variables are available
1069# prehook: /usr/bin/printenv >/tmp/before
1070
1071
1072
1073# PostHook : gets executed after the job has been added to the history.
1074# posthook has access to all the environment variables defined above,
1075# as well as two additionnal environment variables : PYKOTAJOBPRICE
1076# and PYKOTAJOBSIZE.
1077# PYKOTAPHASE contains 'AFTER' during execution of posthook.
1078#
1079# uncomment the line below to see what environment variables are available
1080# posthook: /usr/bin/printenv >/tmp/after
1081
1082
1083
1084# AccountBanner : how should banner accounting be done ?
1085#
1086# If enabled, banner pages printed from StartingBanner and/or EndingBanner
1087# (depending on the value) will be included in the accounting for the
1088# print job
1089#
1090# If disabled, banner pages printed from StartingBanner and EndingBanner will
1091# *not* be included in the accounting for the print job
1092#
1093# IMPORTANT : CUPS generated banners are ALWAYS accounted for, although you
1094#             can refund them by using negative prices on printers.
1095#
1096# Allowed values : Starting | Ending | None | Both
1097#
1098#       - Starting : only the starting banner will be accounted for.
1099#       - Ending : only the ending banner will be accounted for.
1100#       - Both : both starting and ending banners will be accounted for.
1101#       - None : banners will not be accounted for.
1102#
1103# Default value :
1104# accountbanner: Both
1105
1106
1107
1108# Maximal number of times the banner will still be printed if
1109# the user is forbidden to print.
1110#
1111# This option can be set either globally or on a per printer basis.
1112# Allowed values are 0 or any positive integer.
1113# Default value is 0, which means that the banner won't be printed
1114# at all if the user is forbidden to print.
1115#
1116maxdenybanners: 0
1117
1118
1119
1120# If a job is cancelled, should any start or end banners still be printed
1121#
1122# This option can be set either globally or on a per printer basis.
1123# If set to yes, any defined banners will be printed
1124# If set to no, no banners will be printed
1125#
1126# This value defaults to yes
1127# printcancelledbanners: yes
1128
1129
1130# If a job is printed by the same person as the last job on the same printer,
1131# should banners be avoided to save some paper
1132#
1133# This option can be set either globally or on a per printer basis.
1134# If set to yes, any duplicate banners will be avoided forever
1135# If set to no or 0, no banners will be avoided (they will all be printed)
1136# If set to any positive integer, banners will be avoided if printed within
1137#     'integer' seconds of the last job
1138#
1139# This value defaults to no
1140# avoidduplicatebanners: yes
1141# avoidduplicatebanners: no
1142# avoidduplicatebanners: 600
1143
1144
1145# StartingBanner : if defined will print a banner before the rest of the job
1146# is printed. The argument can be a printable file, or an executable file.
1147# If not executable, the file will be printed as is. If executable, the
1148# file will be executed and its standard output will be sent to the printer.
1149#
1150# In any case, the banner content which will be sent to the printer
1151# MUST be in a format your printer will accept !!!
1152#
1153# The pkbanner command included in PyKota can automatically generate
1154# starting and ending banners in the PostScript format. You can use
1155# this command in a pipe through GhostScript if your printer doesn't
1156# accept PostScript as an input format.
1157# NB : pkbanner's default page size is A4
1158#
1159# startingbanner: /home/joe/mystaticbanner.ps
1160# startingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com"
1161# startingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono -
1162# startingbanner: /usr/bin/pkbanner
1163
1164
1165
1166# EndingBanner : if defined will print a banner after the job
1167# has been printed. The argument can be a printable file, or an executable file.
1168# If not executable, the file will be printed as is. If executable, the
1169# file will be executed and its standard output will be sent to the printer.
1170#
1171# In any case, the banner content which will be sent to the printer
1172# MUST be in a format your printer will accept !!!
1173#
1174# The pkbanner command included in PyKota can automatically generate
1175# starting and ending banners in the PostScript format. You can use
1176# this command in a pipe through GhostScript if your printer doesn't
1177# accept PostScript as an input format.
1178# NB : pkbanner's default page size is A4
1179#
1180# A static banner page
1181# endingbanner: /home/joe/mystaticbanner.ps
1182#
1183# A banner with personnalized logo and url
1184# endingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com"
1185#
1186# A banner in the format accepted by the printer
1187# endingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono -
1188#
1189# A banner with more info on it, extracted from the yellow pages.
1190# the string "Phone 111222333444" will be added to the banner page
1191# if extractphone.sh returns 111222333444 for the current user.
1192# endingbanner: /usr/bin/pkbanner Phone `extractphone.sh $PYKOTAUSERNAME`
1193#
1194# Default PyKota banner
1195# endingbanner: /usr/bin/pkbanner
1196
1197
1198
1199# How should enforcement be done for this printer ?
1200#
1201# "laxist" is the default if value is not set, and allows users
1202# to be over quota on their last job.
1203#
1204# "strict" tries to prevent users from ever being over quota.
1205#
1206# Enforcement can be defined either globally, per printer,
1207# or both. If both are defined, the printer specific enforcement
1208# setting has priority.
1209#
1210# valid values : "strict" or "laxist"
1211#
1212# default value when not set is "laxist"
1213#
1214# enforcement : laxist
1215enforcement : strict
1216
1217
1218
1219# Should we trust the job size on this printer ?
1220#
1221# "trustjobsize : yes" is the default, the jobsize, either computed
1222# by the hardware or by software is trusted.
1223#
1224# "trustjobsize : >N:precomputed" : uses the precomputed value
1225#                                   if jobsize > N pages
1226# "trustjobsize : >N:25" : uses 25 if jobsize is >N pages
1227#
1228# General form : ">n:m" where n is a positive integer, and m is
1229# either the word 'precomputed' or a positive integer.
1230# The special form "yes" is also accepted and is the default.
1231#
1232# This directive can be set either globally or on a per printer
1233# basis. Use this directive when hardware accounting for a particular
1234# printer produces some glitches due to the printer returning
1235# incorrect answers.
1236#
1237# NB : DON'T MODIFY THIS IF YOU DON'T NEED TO. THIS IS ONLY TO BE USED
1238# AS A WORKAROUND FOR SOME PRINTERS. IT'S PROBABLY BETTER TO ALWAYS
1239# SET THIS DIRECTIVE TO 'yes'. THIS DIRECTIVE WILL ONLY BE HONORED
1240# IF PYKOTA DETECTS A DIFFERENCE BETWEEN THE PRECOMPUTED JOB SIZE
1241# AND THE JOB SIZE AS COMPUTED BY PYKOTA EITHER USING HARDWARE OR
1242# SOFTWARE.
1243#
1244trustjobsize : yes
1245
1246
1247
1248# Should we deny duplicate jobs ?
1249#
1250# A duplicate is a job sent twice (or more) in a row to the same printer
1251# by the same user.
1252#
1253# This can be defined either globally or on a per printer basis
1254# The default value is 'no', meaning that duplicate jobs are
1255# allowed.
1256#
1257# NB : if an user prints a job, a second user prints another
1258#      job, and the first user prints the first job again,
1259#      this is NOT considered as a duplicate since the two
1260#      identical jobs printed by the first user are not
1261#      one just after the other.
1262#
1263# Possible values are 'yes', 'no', or any other string.
1264# If the string is not recognized as a truth value,
1265# it is considered to be a command to launch.
1266# PyKota launches the command and parses its standard
1267# output. The special keywords 'ALLOW' and 'DENY' are
1268# recognized, allowing an external tool to decide if
1269# the job is to be allowed or denied.
1270#
1271# denyduplicates : /usr/bin/myowncommand with some arguments
1272# denyduplicates : yes
1273denyduplicates : no
1274
1275
1276
1277# Sets the delay in seconds after which two identical jobs are
1278# not considered as being a duplicate.
1279#
1280# This can be defined either globally or on a per printer basis
1281# The default value if not set is 0, for 0 seconds.
1282# duplicatesdelay : 300
1283duplicatesdelay : 0
1284
1285
1286
1287# Sets the maximum number of seconds to wait for the printer
1288# being in 'printing' mode once the job has been sent to it.
1289# Once this delay is expired, PyKota will consider this job
1290# will never be printed, aborts the hardware accounting
1291# process, and uses the latest internal page counter value seen.
1292#
1293# Increasing this value, or setting it to 0, may help with some
1294# printers which don't conform to RFC3805. Problem reported on a
1295# Samsung ML2551n gave a way for clever students to bypass
1296# hardware accounting entirely by removing the paper from
1297# the paper tray before the job had begun to print, then
1298# waiting 60 seconds, and putting the paper back in the tray...
1299#
1300# IMPORTANT : always ensure that your printers' firmware is up
1301# to date.
1302#
1303# This directive can be set either globally or on a per printer
1304# basis.
1305#
1306# When not set, an hardcoded value of 60 seconds is used.
1307# When set to 0, PyKota will wait indefinitely until the
1308# printer switches to the 'printing' status.
1309noprintingmaxdelay : 60
1310
1311
1312
1313# Defines the number of times the 'idle' printer status
1314# has to be reported before it being considered stable.
1315# Each check is done every 'statusstabilizationdelay' seconds
1316# as defined below.
1317#
1318# This directive can be set either globally or on a per printer
1319# basis.
1320#
1321# When not set, an hardcoded value of 5 times is used.
1322# The value must be a strictly positive integer.
1323statusstabilizationloops : 5
1324
1325
1326
1327# Defines the number of seconds to wait between two consecutive
1328# checks of the printer's status when using hardware accounting.
1329#
1330# Each check is done up to 'statusstabilizationloops' times.
1331#
1332# This directive can be set either globally or on a per printer
1333# basis.
1334#
1335# When not set, an hardcoded value of 4.0 seconds is used.
1336# The value must be a positive floating point value greater
1337# than or equal to 0.25 seconds.
1338statusstabilizationdelay : 4.0
1339
1340
1341
1342# Defines a (16 bits) bit mask to specify the set of error conditions
1343# reported through SNMP for which PyKota has to wait indefinitely
1344# until such an error is fixed before continuing with printing
1345# and/or accounting.
1346#
1347# This directive can be set either globally or on a per printer
1348# basis.
1349#
1350# The 16 bit values are specified as in RFC3805 (Printer MIB v2),
1351# as an ORed value of one or more of the following conditions :
1352#
1353#       1000 0000 0000 0000 : Low Paper
1354#       0100 0000 0000 0000 : No Paper
1355#       0010 0000 0000 0000 : Low Toner
1356#       0001 0000 0000 0000 : No Toner
1357#       0000 1000 0000 0000 : Door Open
1358#       0000 0100 0000 0000 : Jammed
1359#       0000 0010 0000 0000 : Offline
1360#       0000 0001 0000 0000 : Service Requested
1361#       0000 0000 1000 0000 : Input Tray Missing
1362#       0000 0000 0100 0000 : Output Tray Missing
1363#       0000 0000 0010 0000 : Marker Supply Missing
1364#       0000 0000 0001 0000 : Output Near Full
1365#       0000 0000 0000 1000 : Output Full
1366#       0000 0000 0000 0100 : Input Tray Empty
1367#       0000 0000 0000 0010 : Overdue Preventive Maintainance
1368#       0000 0000 0000 0001 : Not assigned
1369#
1370# When not set, an hardcoded value of hexadecimal 0x4FCC is used,
1371# which means that PyKota will wait indefinitely when using SNMP
1372# hardware accounting if one of the following conditions is met :
1373#
1374#   No Paper, Door Open, Jammed, Offline, Service Requested,
1375#   Input Tray Missing, Output Tray Missing, Output Full, Input Tray Empty
1376#
1377# This value can be specified either in hexadecimal (prefixed with 0x),
1378# in octal (prefixed with 0) or in decimal (no prefix).
1379#
1380snmperrormask : 0x4FCC
1381
1382
1383
1384# Defines a set of coefficients for ink accounting.
1385#
1386# Each ink coefficient is the factor of the price per page
1387# you set with pkprinters which would represent the cost
1388# of a page covered at 100% with ink in this particular color.
1389#
1390# With these coefficients, the exact cost of each page
1391# can be computed : for each ink color in the colorspace specified
1392# in the preaccounter and/or accounter directives, we multiply the
1393# base cost per page set with pkprinters by this ink color's coefficient
1394# and by the percent of that page covered with such ink. Then we
1395# sum the values, and repeat the operation for each page. We then
1396# add the base cost per job set with pkprinters, and repeat
1397# the operation recursively in case of nested printers groups.
1398#
1399# The names of the coefficients you should set depend on the colorspace
1400# you want to use for ink accounting :
1401#
1402#       cmyk :
1403#               coefficient_cyan
1404#               coefficient_magenta
1405#               coefficient_yellow
1406#               coefficient_black
1407#
1408#       cmy :
1409#               coefficient_cyan
1410#               coefficient_magenta
1411#               coefficient_yellow
1412#
1413#       rgb :
1414#               coefficient_red
1415#               coefficient_green
1416#               coefficient_blue
1417#
1418#       bw :
1419#               coefficient_black
1420#
1421#       gc :
1422#               coefficient_grayscale
1423#               coefficient_colored
1424#
1425# Any coefficient which is not set is considered to be equal to 1.0
1426#
1427# Coefficients can be set either in the [global] section or in any
1428# [printqueuename] section. The latter taking precedence, as always.
1429#
1430#coefficient_cyan : 1.2
1431#coefficient_magenta : 3
1432#coefficient_yellow : 1.1
1433#coefficient_black : 1.0
Note: See TracBrowser for help on using the browser.