Changeset 1475 for pykota/trunk/conf

Show
Ignore:
Timestamp:
05/13/04 15:59:30 (20 years ago)
Author:
jalet
Message:

Code simplifications

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/conf/pykota.conf.sample

    r1442 r1475  
    182182# supported values : 
    183183# 
    184 #    - querying : asks the printer for its lifetime page counter 
     184#    - hardware : asks the printer for its lifetime page counter 
    185185#                 via either SNMP, AppleTalk, or any external 
    186186#                 command. This method is the method used by 
    187187#                 default in PyKota since its beginning. 
    188188# 
    189 #    - external : delegates the job's size computation to any  
    190 #                 external command of your choice. A stupid and  
    191 #                 completely unreliable example, but which 
    192 #                 shows what this command may be is : 
    193 # 
    194 #                   accounter: external(/bin/grep -c showpage) 
    195 # 
    196 #                 Another one, which should work with all DSC 
    197 #                 compliant Postscript files : 
    198 # 
    199 #                   accounter: external(/bin/grep -c "%%Page:") 
    200 # 
    201 #                 Finally the new smart external accounter which 
    202 #                 can handle both PostScript and PCL documents : 
    203 # 
    204 #                   accounter: external(/usr/bin/pkpgcounter) 
    205 #  
    206 #    - stupid : counts the occurences of the 'showpage' postscript 
    207 #               statement in the document to be printed. 
    208 #               THIS IS NOT RELIABLE. This is just to serve as 
    209 #               an example on how to implement your own accounting 
    210 #               method. Use pkpgcounter instead. 
    211 # 
     189#    - software : delegates the job's size computation to any  
     190#                 external command of your choice.  
     191# 
     192#                 best choice for this is probably to set it 
     193#                 this way : 
     194# 
     195#                   accounter: software(/usr/bin/pkpgcounter) 
     196# 
     197#                 pkpgcounter is a command line tool which is 
     198#                 part of PyKota and which can handle both 
     199#                 DSC compliant PostScript documents and PCL5 
     200#                 documents. More file formats will be added 
     201#                 in the future, as time permits. 
     202# 
     203#                 while pkpgcounter is the recommended value 
     204#                 you can use whatever command you want provided 
     205#                 that your command accepts the job's data on its 
     206#                 standard input and prints the job's size in pages 
     207#                 as a single integer on its standard output. 
     208#  
    212209# This value can be set either globally or on a per printer basis 
    213210# If both are defined, the printer option has priority. 
    214 # if not set it defaults to 'querying'. 
    215 # 
    216 # A script which seems to be accurate, copy it from the 
    217 # untested/postscript directory to another place. 
    218 # accounter: external(/usr/share/pykota/pagecount.sh) 
    219 # WARNING : it may not work when multiple copies are asked. 
    220 #           this breaks ghostscript, I don't know why yet. 
     211# if not set it defaults to 'hardware'. 
    221212# 
    222213# default value  
    223 accounter: querying 
     214accounter: hardware 
     215# accounter: software(/usr/bin/pkpgcounter) 
    224216 
    225217# Print Quota administrator 
     
    326318 
    327319# How to query the hpmarketing printer for its page counter. 
    328 # THIS IS ONLY USED IF YOU HAVE SET 'accounter' TO 'querying' 
     320# THIS IS ONLY USED IF YOU HAVE SET 'accounter' TO 'hardware' 
    329321# JUST COMMENT IT OUT IF YOU USE ANY OTHER ACCOUNTING METHOD. 
    330322# (it would be ignored anyway) 
     
    332324# In the lines below "%(printer)s" is automatically replaced 
    333325# at run time with your printer's Fully Qualified Domain Name 
     326# for network printers. 
    334327# e.g. myprinter.example.com 
    335328# 
    336 # Only snmp(community, oid) and external(command) are supported 
     329# Only value supported is : external(... your command here...)  
    337330# 
    338331# Example :  
     332# 
    339333#     requester: external(/usr/bin/snmpget -v1 -c public -Ov %(printer)s mib-2.43.10.2.1.4.1.1 | cut -f 2,2 -d " ") 
    340 # and : 
    341 #     requester: snmp(public, mib-2.43.10.2.1.4.1.1) 
    342 # are equivalent 
    343 # 
    344 ################################################# 
    345 # NB : the 'snmp()' requester is now deprecated # 
    346 # because it has some accuracy problems.        # 
    347 # please use 'external()' instead.              # 
    348 ################################################# 
    349334# 
    350335# Another untested example, using npadmin : 
     336# 
    351337#     requester: external(/usr/bin/npadmin --pagecount %(printer)s) 
    352338# 
     
    355341# pagecount.ps file from untested/netatalk into /etc or any  
    356342# appropriate location) 
     343# 
    357344#     requester: external(/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) 
    358345# 
     
    361348#     requester: external(/bin/cat /usr/share/pykota/pagecount.pjl >/dev/lp0 && /usr/bin/head -2 </dev/lp0 | /usr/bin/tail -1) 
    362349#  
    363 #  
    364350# This value can be set either globally or per printer or both. 
    365351# If both are defined, the printer option has priority. 
    366 # 
    367 # NB : The SNMP oid mib-2.43.10.2.1.4.1.1 works on HP Laserjet Printers, but it may 
    368 #      be different with other brands, refer to your printer's documentation  
    369 #      for details. Also you may have to specify -v2c or -v3 depending on your  
    370 #      printer's support for different versions of the SNMP specification. 
    371 # 
    372352# 
    373353# Some examples and comments provided by Bob Martel from csuohio.edu 
     
    382362# 
    383363# requester: external(/opt/local/net-snmp/bin/snmpwalk -v 1 -Cc -c public -Ov %(printer)s | grep Counter32 | tail -2 | head -1 | cut -d " " -f2) 
    384 # 
    385364# 
    386365# An example using netcat and a preformatted PJL job which you can find 
     
    390369# requester: external(/bin/nc -w 2 %(printer)s 9100 </usr/share/pykota/pagecount.pjl | /usr/bin/tail -2) 
    391370# 
    392 # 
    393371# An example using the contributed pagecount.pl script which does  
    394372# the same as above, but should work on more printers :  
    395373# 
    396374# requester: external(/usr/share/pykota/pagecount.pl %(printer)s 9100) 
    397 # 
    398375# 
    399376# WARNING : In any case, when using an external requester, please test the command line outside 
     
    404381# not yet finished (not all pages are printed, but the complete job is in  
    405382# the printer) 
     383# 
     384# YOU ABSOLUTELY HAVE TO BE SURE YOU HAVE A SCRIPT WHICH WAITS FOR THE 
     385# PRINTER BEING READY BEFORE ASKING FOR ITS INTERNAL PAGE COUNTER. 
     386# 
     387# PYKOTA INCLUDES SUCH SCRIPTS FOR SNMP AND APPLETALK PRINTERS, MORE TO COME 
     388# 
     389# default value 
    406390requester: external(/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 " ") 
    407391