print pages accounting

print pages accounting

Post by <RodriGore> » Wed, 12 Mar 2003 06:35:18



Hello friends,
firsth of all i want to aplogice, but mi english is basic. wathever i want
ask if one of you can helpme with the next problem.
i have a hp laser 5m working in a redhat 7.2 server running with samba, and
i cant count how many pages print each user, the only information i have is
in /var/spool/lpd/hplaaser5m/hplaser5m.acct is this:

jobstart '-Hlocalhost.localdomain' '-njeanette' '-Phplaser5m'
'-kcfA040localhost.localdomain' '-b314471' '-t2003-03-10-13:53:14.000'
jobend '-Hlocalhost.localdomain' '-njeanette' '-Phplaser5m'
'-kcfA040localhost.localdomain' '-b314471' '-t2003-03-10-14:04:15.000'
jobstart '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
'-kcfA142localhost.localdomain' '-b3014' '-t2003-03-10-14:04:15.000'
jobend '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
'-kcfA142localhost.localdomain' '-b3014' '-t2003-03-10-14:27:46.000'
jobstart '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
'-kcfA296localhost.localdomain' '-b217569' '-t2003-03-10-14:49:14.000'
jobend '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
'-kcfA296localhost.localdomain' '-b217569' '-t2003-03-10-14:49:23.000'
jobstart '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
'-kcfA327localhost.localdomain' '-b157030' '-t2003-03-10-14:56:41.000'
jobend '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
'-kcfA327localhost.localdomain' '-b157030' '-t2003-03-10-14:56:46.000'
jobstart '-Hlocalhost.localdomain' '-nrferrada' '-Phplaser5m'
'-kcfA357localhost.localdomain' '-b2727' '-t2003-03-10-15:08:15.000'
jobend '-Hlocalhost.localdomain' '-nrferrada' '-Phplaser5m'
'-kcfA357localhost.localdomain' '-b2727' '-t2003-03-10-15:08:15.000'

how do you see, i have how many bytes have each work, but i dont know how to
"translate" to number of pages.

best regards..

RodriGore
From South of the World
The last corner

 
 
 

print pages accounting

Post by Captain Dond » Wed, 12 Mar 2003 19:14:31



> Hello friends,
> firsth of all i want to aplogice, but mi english is basic. wathever i want
> ask if one of you can helpme with the next problem.
> i have a hp laser 5m working in a redhat 7.2 server running with samba, and
> i cant count how many pages print each user, the only information i have is
> in /var/spool/lpd/hplaaser5m/hplaser5m.acct is this:

> jobstart '-Hlocalhost.localdomain' '-njeanette' '-Phplaser5m'
> '-kcfA040localhost.localdomain' '-b314471' '-t2003-03-10-13:53:14.000'
> jobend '-Hlocalhost.localdomain' '-njeanette' '-Phplaser5m'
> '-kcfA040localhost.localdomain' '-b314471' '-t2003-03-10-14:04:15.000'
> jobstart '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
> '-kcfA142localhost.localdomain' '-b3014' '-t2003-03-10-14:04:15.000'
> jobend '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
> '-kcfA142localhost.localdomain' '-b3014' '-t2003-03-10-14:27:46.000'
> jobstart '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
> '-kcfA296localhost.localdomain' '-b217569' '-t2003-03-10-14:49:14.000'
> jobend '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
> '-kcfA296localhost.localdomain' '-b217569' '-t2003-03-10-14:49:23.000'
> jobstart '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
> '-kcfA327localhost.localdomain' '-b157030' '-t2003-03-10-14:56:41.000'
> jobend '-Hlocalhost.localdomain' '-njlema' '-Phplaser5m'
> '-kcfA327localhost.localdomain' '-b157030' '-t2003-03-10-14:56:46.000'
> jobstart '-Hlocalhost.localdomain' '-nrferrada' '-Phplaser5m'
> '-kcfA357localhost.localdomain' '-b2727' '-t2003-03-10-15:08:15.000'
> jobend '-Hlocalhost.localdomain' '-nrferrada' '-Phplaser5m'
> '-kcfA357localhost.localdomain' '-b2727' '-t2003-03-10-15:08:15.000'

> how do you see, i have how many bytes have each work, but i dont know how to
> "translate" to number of pages.

> best regards..

> RodriGore
> From South of the World
> The last corner

Page accounting is very difficult.  If the printer supports some sort of
query, I typically set up an input filter (if= in printcap) which polls
the printer until it's not busy, then queries for the page count, then
sends the job.  At the end of the job, I query the printer again for the
page count, subtract the two, and log the result.

This slows down printing somewhat - the printer cannot spool the next job
while the current one is printing.

If the printer doesn't support queries (via SNMP or similar) then you have
to run a pre-processor to "print" the job to a NULL device, and count the
number of resulting pages.  AFAIK, this can only be done with Postscript
and Ghostscript.

If you're using HP's native language, then I have no idea how to
accurately count pages from the printer binary file.

-Dondo

 
 
 

1. printing pages account in a remote printer

I would like to control the number of pages each user send to print, in
order to avoid abuses of printing...
I'm using Linux (wich uses a lpr style printing)
Jobs to the remote printer are sent via nfs from windows to the Linux nfs
server.
The Remote printer is a HP laserJet 4M plus, conected directly to the net.
This printer only accept request from the linux machine.
The problems are:

        -Linux doesn't support filters for remote printers, i have find a
solution in the pcnfsd.conf, there you can specify a command to preprocess
the file that it is send to the printer.
I have planned to incorporate in this command a shell script that ask to the
printer the number of pages (via snmp the 4M plus support it), and the when
the job is finished see the page counter to calculate the printed pages.
        - How can you guess that a job is finished?
        - How can you are sure that you are not considering the start of one
job with the end of another one? (that is calculating bad the pages for one
 user)
        I have heard about pac, but it is for use with TEX, dvi, ascii,
ps...files but not with printer formated files of windows.(at least i don't
know any filter for it ;-) ).

If anybody has made something similar to this, I would appreciate any hints,
or configuration script.
Please answer by mail, if anybody is interested in this subject, If we all
find a solution i will post it for everybody

Thank you for your time!

--
----------------------------------------------------------
Jorge Rodriguez Bringas                   \|/   ___   \|/

Fac. Ciencias ,Valladolid (SPAIN)         /__( \___/ )__\

----------------------------------------------------------

2. ET4000/W32 and W32-Server

3. Graphical to Command Line Login

4. Stylus Pro XL+ prints an empty page after every printed page

5. Need desperate help with Asuscom 128K ISDN Inst.

6. print server: page accounting wanted

7. 2.5.43-mm2

8. Automated accounting of pages printed to PostScript printers

9. Printing a pdf file duplex and 4 pages per page to a postscript printer

10. Printing 2 postscript pages to 1 physical page ...

11. How to print from last page to first page?

12. Printing: multiple logical pages per physical page