Reader small image

You're reading from  CUPS Administrative Guide

Product typeBook
Published inSep 2008
Publisher
ISBN-139781847192585
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
Ankur Shah
Ankur Shah
author image
Ankur Shah

Ankur Shah has been working with Linux/AIX for last 4 years as a System Administrator. His previous assignment was with Packt Publishing, where he worked as System Administrator and also started implementing CUPS. He completed his graduation in Computer Engineering from Nagpur University, India. He is currently working as a SAP Basis Administrator and also started working on Governance Risk and Compliance for access Control. He is also interested in Oracle Database Administration and Security. He is the biggest fan of Kajol (a Bollywood actress) and dedicates this book to her. The day her movie releases is a day of celebration for him and he only parties once a year - 5th August - that's Kajol's birthday. It goes without saying that he watches all her movies several times - often dragging his friends and family to participate in his madness.
Read more about Ankur Shah

Right arrow

Chapter 7. Quota Management

The CUPS printing system can manage print jobs based on quotas. Although the quota management in CUPS is not as full-featured as it could be, we will discuss both it's strengths and weaknesses in this chapter.

Setting up Quota in CUPS

As we have discussed in the earlier chapters, quotas can be set with the -o (option) parameter while installing a printer, or later with the lpadmin command for an already existing printer. Quotas can be setup with the following options:

  • CUPS supports the page-count and file size-based quotas for each printer.

  • Quotas are calculated for each user individually. Thus a single set of limits applies to all users for the concerned printer.

  • Quotas can include banner pages (if those are used). It means that we can put a limit on every user to print a certain number of pages (say 10 pages) per day on an expensive printer.

  • Options such as job-k-limit, job-page-limit, and job-quota-period are very important for defining quota while setting up a...

Setting up Quota in CUPS


As we have discussed in the earlier chapters, quotas can be set with the -o (option) parameter while installing a printer, or later with the lpadmin command for an already existing printer. Quotas can be setup with the following options:

  • CUPS supports the page-count and file size-based quotas for each printer.

  • Quotas are calculated for each user individually. Thus a single set of limits applies to all users for the concerned printer.

  • Quotas can include banner pages (if those are used). It means that we can put a limit on every user to print a certain number of pages (say 10 pages) per day on an expensive printer.

  • Options such as job-k-limit, job-page-limit, and job-quota-period are very important for defining quota while setting up a printer.

  • job-k-limit has a default value 0, which specifies that there is no limit.

  • job-page-limit has a default value 0, which specifies that there is no limit.

  • job-quota-period sets a time interval for quota computing. The default value...

Correct and Incorrect Accounting


While printing in CUPS, the count should be tracked correctly. The filter pstops will give the correct count value when the printfile passes through it. Without this filtering, CUPS will use a dummy count of "one". Some print files (for example image files) do not pass through this filter. But that doesn't affect the accounting as most of the image files are one page jobs. This also means that proprietary drivers for the target printer running on the client computers and CUPS/Samba, which then spool these files as "raw" (leaving them untouched, not filtering them), will be counted as a one page file as well. In such a scenario, you need to send PostScript from the clients (that is, run a PostScript driver on the client machine to have proper accounting of the correct number of pages). If the printer is a non-PostScript model, you need to let CUPS convert the file to a print-ready format for the target printer.

Overview of the page_log file


You will find the following items in the CUPS page_log file for each page in a job:

  • Printer name: The printer field contains the name of the printer that prints the page. If a job is sent to a printer class, this field will contain the name of the actual printer that was assigned the job.

  • User name: The user field contains the name of the user who submitted the print job for printing. The user's name is obtained from the IPP requesting-user-name attribute.

  • Job ID: The job-id field contains the job number of the page being printed. The job numbers are reset to "1" whenever the CUPS server is started. So, it is recommended that you don't depend on this number being unique.

  • Time of printing: The date-time field contains the date and time of request in local time when the page started printing, and its format is: [DD/MMM/YYYY: HH:MM:SS+ZZZZ], where:

    • DD—The day of the month between 01 and 31

    • MMM—Month name in 3 characters.(examples, Jan, Feb, and so on)

    • YYYY—A four-digit...

Flaws of the CUPS Quota system


As flexible as the CUPS quota system is, it has a few flaws that you will need to keep in mind:

  • The CUPS quota system works only if the printers are working properly. If the printer hardware has failed, the log information may not be correct.

  • CUPS counts the job pages that are being processed by the software (that is, going through the RIP) rather than the physical sheets successfully leaving the printing device. If there is a jam while say printing the tenth sheet out of 100, and the job is aborted by the printer, the page count will still show that 100 pages were processed for that job.

  • With this system, there is no provision to set up quotas for individual users. Quotas can be turned on or off for individual users, but it is not possible to assign different quota levels. If you want to give senior management higher quotas than the rest of the employees, you cannot do this with CUPS.

  • You cannot see how much of the quota users have left for the assigned time...

Other Accounting Tools


Though CUPS has its own quota system, there are other accounting systems you can use with CUPS.

The most well-known and feature-rich free software package for print accounting and quotas is PyKota (http://www.pykota.com/). We will discuss this in detail in a moment.

A simple system based on reading out the hardware counter of network printers via SNMP is accsnmp. More information is available on:

http://fritz.potsdam.edu/projects/cupsapps/

There are other accounting tools that can be used with CUPS, including PrintAnalyzer, printbill, and LogReport.

You can find more information about PrintAanlyzer at:

http://savannah.nongnu.org/projects/printanalyze/

The information about printbill can be found at:

http://ieee.uow.edu.au/~daniel/software/printbill/index.shtml

You can also find out more information about LogReport at:

http://www.logreport.org/

PyKota

As we have seen, CUPS features its own simple print quota system which is not extensible and lacks many of the features...

Summary


In this chapter, we have discussed quota management with CUPS. As a managed printer system, CUPS provides features to manage printers by setting up quotas. Currently there are a number of improvements such as more flexibility, advanced accounting, and support for other tools around quotas planned in the future versions of CUPS. Though CUPS has very limited internal features to handle complex scenarios, more can be achieved through a CUPS add-on quota system such as PyKota. It is a granular quota management system that has the ability to manage printers and users and can fill a gap left by CUPS built-in quota management system.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
CUPS Administrative Guide
Published in: Sep 2008Publisher: ISBN-13: 9781847192585
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Ankur Shah

Ankur Shah has been working with Linux/AIX for last 4 years as a System Administrator. His previous assignment was with Packt Publishing, where he worked as System Administrator and also started implementing CUPS. He completed his graduation in Computer Engineering from Nagpur University, India. He is currently working as a SAP Basis Administrator and also started working on Governance Risk and Compliance for access Control. He is also interested in Oracle Database Administration and Security. He is the biggest fan of Kajol (a Bollywood actress) and dedicates this book to her. The day her movie releases is a day of celebration for him and he only parties once a year - 5th August - that's Kajol's birthday. It goes without saying that he watches all her movies several times - often dragging his friends and family to participate in his madness.
Read more about Ankur Shah