1830888 Members
1494 Online
110017 Solutions
New Discussion

Tracking Print Queues

 
TheJuiceman
Super Advisor

Tracking Print Queues

Hi everyone,

Has anyone written a script that they are willing to share? I would like to track printer usage to any given printer by user, total entries, number of pages printed, and usage by time of day (to create a trending graph). Is any of this possible on 11.11? Thanks.
Bobby
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Tracking Print Queues

You could extract limited data from /var/spool/lp/log but the better approach would either be to create a wrapper script for the lp command that in turn calls the "real" lp command.

Plan B: Create a script that is called by each /var/spool/lp/interface/printername. Essentially you would add 1 line to each of your interface files. The interface receives the printer_name, request_id, user, title, copies, options, and the full path of the file to be printed. You could pass these on to your script.

Finally, page numbers are all but meaningless these days unless you are printing ASCII text only. PCL, Postscript, and graphics make pages meaningless except to the application that generates the output stream.
If it ain't broke, I can fix that.
TheJuiceman
Super Advisor

Re: Tracking Print Queues

I realize page numbers may be difficult, but byte size would be helpful.
TheJuiceman
Super Advisor

Re: Tracking Print Queues

Clay,

I'm curious about the lp wrapper idea. Have any idea how to write and implement something like that?

Thanks
Ralph Grothe
Honored Contributor

Re: Tracking Print Queues

Hi Bobby,

if you want to monitor consumables' consumption (is this a tautology?, sorry English isn't my native tongue)
,e.g. like pages printed, from which tray, filling of cartriges etc., I would go for SNMP.
If the printers in use aren't quite of the budget commodity type they are most likely to keep counters that can be queried by SNMP.

I'm afraid not being able to offer you any ready scripts for this purpose since my sort of administrative tasks aren't focused around printers (lucky me), why I haven't cared yet for writing those.
But I do have an O'Reilly book at my shelf about Network Printing that has several code examples to do exactly this.
I also lack knowing the required OIDs by heart, but such a refernce as the mentioned book will tell.
Madness, thy name is system administration
Raj D.
Honored Contributor

Re: Tracking Print Queues

Hi Bobby ,

The simple answer would be through :

/var/spool/lp/log and lpstat ..

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "