[cups] CUPS basic accounting

Helge Blischke helgeblischke at web.de
Fri Mar 20 11:13:40 PDT 2020



> Am 20.03.2020 um 18:05 schrieb sawbona at xsmail.com:
> 
> Hello:
> 
> I'm looking for a way to be able to know (without too much fuss) how
> many pages my Samsung M2020W has printed at any point in time.
> 
> Although not really at any point, usually when I see that the print 
> density/quality is falling.
> 
> The original OEM cartdrige lasted for few pages (I know that is the 
> usual thing) so I have had it refilled and would like to keep a tab 
> on how well the refill actually works. ie: lives up to what the 
> refill service says.
> 
> There's the log at http://localhost:631/admin/log/page_log which is 
> read from /var/log/cups/page_log but I don't see how to weed out the
> data without some time consuming editing and manual accounting.
> 
> I have tried using awk on the /var/log/cups/page_log file but have 
> not been able to get reliable results as the parsed numbers can have
> between 1 and 4 digits within the same page_log file.
> 
> What I need is simple enough:  (?)
> 
> There's only one printer and I'm the only one local user.
> 
> I only want to know how many pages were printed between the date I 
> put in the new/reloaded cartdrige and the date printing started to 
> degarde.
> 
> Any pointers will be appreciated.
> 
> Thanks in advance,
> 
> G.
Instead of using awk, I’d suggest to use a Perl or Python script, as both provide a fairly easy to use
regular expression tool. Another suggestion would be to use Tea4CUPS (a free utility written in Python
which allows to implement flexible means for all kind of accounting tasks.

As the layout of the page_log entries is highly configurable, I think there are very few, if any, out of the box solutions.

Helge



More information about the cups mailing list