Below are some of my notes regarding getting print accounting working with cups.
A lot of the notes I read imply that decent accounting is impossible if you send PCL to cups. What you should be doing is sending PS, and having CUPS re-render it in PCL for you. Or something like that.
If you can at all, use a vendor provided PPD. I have an HP 4550 Color Laserjet printer on my network, and I was using the foomatic PPD that comes with cups. All fine and good, it prints just fine, however I discovered that I was getting no accounting information out of it at all. I discovered that setting the clients to use the PCL driver as opposed to the PS driver meant that it would at least do trivial job account.
I changed to the HP provided PPD (from the windows driver package), and things started working!
Pykota will do accounting in a number of ways. At a basic level, it will do software accounting, and this can accurately account for postscript, PCL5 and PDF format files. PCL6 is in the works.
If you don't trust software, or want to verify that all the pages were printed and feel like asking your printer, there are a few ways of doing things. The most obvious one for a network attached printer is to use an SNMP query and fetch the page counter. Any HP printer with a JetDirect card, and (I think) any other printers with native network cards in them, will support this. If you have a printserver dongle, it may or may not support this option.
The second method involves sending a PJL or PS request to the printer, and have it return its page count. This should work for any printer that supports this feature in either PJL or PS, regardless of your connection mechanism (USB, parallel, network). Both of these are nicer than the naive method in that they account for the number of pages actually printed, however they rely on this cups/accounting server being the only machine that directly talks to the printers in question.
While a bit confusing at first, PyKota? looks like a really good system. Its billing information is currently stored in SQL, so I can easily write scripts to generate custom reports. It also supports LDAP, which I might look into as it will tie in with my authentication system. It doesn't really seem suited for generating weekly usage reports, as it is more focussed as a quota/billing system, however it does keep job histories, so I might investigate using that information to generate periodical usage reports.
--- The author of pykota found this page and corrected me on some mistakes :) -- DanielLawson
lib/main.php:944: Notice: PageInfo: Cannot find action page