|
|
|
BROWSE
All Titles WordPress Web Services SOA BPEL Web Graphics & Video Web Development RAW Portugues, Espanol, Italiano PHP/MySQL Oracle Open Source Networking & Telephony Moodle Microsoft & .NET Linux Servers Joomla! JBoss Java e-Commerce Drupal CRM Content Management Beginner Guides Architecture and Analysis AJAX Future Titles Recently Published Titles |
CUPS: How to Manage Multiple Printers
Configuring Printer ClassesBy default there are no printer classes set up. You will need to define them. The following are some of the criteria you can use to define printer classes:
CUPS always checks for an available printer in the order in which printers were added to a class. Therefore, if you want a high-speed printer to be accessed first, you would add the high-speed printer to the class before you add a low-speed printer. This way, the high-speed printer can handle as many print requests as possible, and the low-speed printer would be reserved as a backup printer when the high-speed printer is in use. It is not compulsory to add printers in classes. There are a few important tasks that you need to do to manage and configure printer classes. Printer classes can themselves be members of other classes. So it is possible for you to define printer classes for high availability for printing. Once you configure the printer class, you can print to the printer class in the same way that you print to a single printer. Features and AdvantagesHere are some of the features and advantages of printer classes in CUPS:
All of these printers hang off Windows machines, and would be available directly for other computers running under Windows. However, we get the following advantages by providing them through CUPS on a central router: Implicit ClassCUPS also supports the special type of printer class called as implicit class. These implicit classes work just like printer classes, but they are created automatically based on the available "printers and printer classes" on the network. CUPS identifies printers with identical configurations intelligently, and has the client machines send their print jobs to the first available printer. If one or more printers go down, the jobs are automatically redirected to the servers that are running, providing fail-safe printing. Managing Printer Classes Through Command-LineYou can perform this task only by using the lpadmin -c command. Jobs sent to a printer class are forwarded to the first available printer in the printer class. Adding a Printer to a ClassYou can run the following command with the –p and -c options to add a printer to a class: $sudo lpadmin –p cupsprinter –c cupsclass The above example shows that the printer cupsprinter has been added to printer class cupsclass: You can verify whether the printers are in a printer class: $lpstat -c cupsclass Removing a Printer from a ClassYou need to run lpadmin command with –p and –r options to remove printer from a class. If all the printers from a class are removed, then that class can get deleted automatically. $sudo lpadmin –p cupsprinter –r cupsclass The above example shows that the printer cupsprinter has been removed from the printer class, cupsclass: Removing a ClassTo remove a class, you can run the lpadmin command with the –x option: $sudo lpadmin -x cupsclass The above command will remove cupsclass. Managing Printer Classes Through CUPS Web InterfaceLike printers, and groups of printers, printer classes can also be managed by the CUPS web interface. In the web interface, CUPS displays a tab called Classes, which has all the options to manage the printer classes. You can get this tab directly by visiting the following URL: http://localhost:631/classes If no classes are defined, then the screen will appear as follows which shows the search and sorting options: ![]() Adding a New Printer ClassA printer class can be added using the Add Class option in the Administration tab. It is useful to have a helpful description in the Name field to identify your class. You can add the additional information regarding the printer class under the Description field that would be seen by users when they select this printer class for a job. The Location field can be used to help you group a set of printers logically and thus help you identify different classes. In the following figure, we are adding all black and white printers into one printer class. The Members box will be pre-populated with a list of all printers that have been added to CUPS. Select the appropriate printers for your class and it will be ready for use. ![]() Once your class is added, you can manage it using the Classes tab. Most of the options here are quite similar to the ones for managing individual printers, as CUPS treats each class as a single entity. In the Classes tab, we can see following options with each printer class: Stop ClassClicking on Stop Class changes the status of all the printers in that class to "stop". When a class is stopped, this option changes to Start Class. This changes the status of all of the printers to "idle". Now, they are once again ready to receive print jobs. Reject JobsClicking on Reject Jobs changes the status of all the printers in that class to "reject jobs". When a class is in this state, this option changes to Accept Jobs which changes the status of all of the printers to "accept jobs" so that they are once again ready to accept print jobs.
Unpublished PrinterThe option Unpublished Printer makes the printer unpublished and that means printer is no longer shared. The published printer option activates the printer shared mode. The default value for any class with respect to above three options is: idle, accepting jobs, published which we can see in Class State. ![]() Cancel All JobsThe option Cancel All Jobs will cancel all the jobs of the class. ![]() Delete ClassTo delete a class, you can use this option. CUPS will show a warning message when a class is deleted. ![]() Modifying a ClassTo change the properties of a class, you can use the Modify Class option. Apart from changing the fields such as Location and Description, you can also add or remove printer/printers from a printer class. ![]() Setting up Printer Options for ClassTo set printer options on a printer class, you can use the Set Printer Options. There are fewer options that can be set on a class. You can set the options for "Banners" and "Policy" for the printer class. Banners include the Starting Banner and Ending Banner (as shown in the following screenshot) for printer. If only one banner file is specified, then it will be printed before the files in the job. If a second banner file is specified, it will be printed after the files in the job. The available banner pages depend on the local system configuration. CUPS includes the following banner files:
Policy includes the options such as Error Policy and Operation Policy (as shown in the following screenshot) that can be setup on the printer classes. The Error Policy field is used to specify the error policy when there is an error in printer while printing a job. You can use options like stop-printer, retry-job, abortjobs, and so on within this option. The Operation Policy is the field that denotes the printing policy for the printer. This policy contains information say on whether the printer is set to as default or not. ![]() Printing a Test Page for a Printer ClassThe Print Test Page option prints a test page which can be used to test the functionality of the printer class. If one of the printers is busy or down, the job is sent to another printer in the same printer class. Setting a Printer Class as DefaultThe printer class can be set as the default using the option Set As Default.When you set up a printer class as the default one, you will get the following note stating that the lpoptions setting will override this default setting. ![]() Set Allowed UsersThe option Set Allowed User is used to restrict users of a printer class. This option will be very useful if someone wants to put usage control on expensive printers, limiting access to the class. Nested Printer ClassesA printer class can also be included within another printer class, this is called as Nested Printer Class. Let's discuss this with an example. The following screenshot shows the printer class cupsclass1 which contains a printer colorprinter and a printer class cupsclass. The printer class cupsclass contains two printers cupsprinter1 and cupsprinter2. Here one of the members of the printer class, cupsclass, is another printer classcupsclass1, this is called nesting of classes. This feature can be very useful for you as the administrator can stop individual printers from accepting jobs, forcing users to use the printer classes. ![]() SummaryIn this article, we have discussed printer classes, their configurations and usage through the command line and web-based interfaces. The advantage of having printer classes is that multiple printers can be used more efficiently (if they are in classes), which means that users can print even if one or more printers in a printer class are down.
About the AuthorAnkur 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 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. Books from Packt | Want to know more about Packt's Article Network? Interested in contributing your article ideas? Please visit our FAQ for more information. See More |
| ||||||||