Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
5.  Administering Printers (Tasks) Setting or Resetting Miscellaneous Printer Definitions Setting Up Printer Classes  Previous   Contents   Next 
   
 

How to Define a Class of Printers

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Define a class of printers.

    # lpadmin -p printer-name -c printer-class

    -p printer-name

    Name of the printer you are adding to a class of printers.

    -c printer-class

    Name of a class of printers.

    The specified printer is added to the end of the list in the class in the print server's /etc/lp/classes/printer-class file. If the printer class does not exist, it is created.

  3. Verify that the printers are in a printer class.

    $ lpstat -c printer-class

Example--Defining a Class of Printers

The following example shows how to add the printer luna in the printer class roughdrafts.

# lpadmin -p luna -c roughdrafts

Setting Up Printer Fault Alerts

If you choose, the print service can notify you when it detects a printer fault. You can select any of the following methods to receive printer fault notification with the lpadmin -A command or with Solaris Print Manager:

  • Write a message to the terminal on which root is logged in

  • Electronic mail to root

  • No notification

However, the lpadmin -A command offers you an additional option of receiving a message specified by the program of your choice. It also enables you to selectively turn off notification for an error that you already know about.

Unless you specify a program to deliver fault notification, the content of the fault alert is a predefined message that says the printer has stopped printing and needs to be fixed.

The following table lists the alert values that you can set for a printer with the lpadmin -A command. These alert values can also be set for print wheels, font cartridges, and forms.

Table 5-3 Values for Printing Problem Alerts

Value for -A alert

Description

'mail [user-name]'

Send the alert message by email to root or lp on the print server, or the specified user-name, which is a name of a user.

'write [user-name]'

Send the alert message to the root or lp console window on the print server, or to the console window of the specified user-name, which is a name of a user. The specified user must be logged in to the print server to get the alert message.

'command'

Run the command file for each alert. The environment variables and current directory are saved and restored when the file is executed.

quiet

Stop alerts until the fault is fixed. Use this when you (root or specified user) receive repeated alerts.

none

Do not send any alerts. This is the default if you don't specify fault alerts for a printer.

How to Set Fault Alerts for a Printer

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Set fault alerts for a printer.

    # lpadmin -p printer-name -A alert [-W minutes]

    -p printer-name

    Name of the printer for which you are specifying an alert for printer faults.

    -A alert

    Specifies what kind of alert will occur when the printer faults. For detailed information about the valid values for alert, see Table 5-3. Some valid values are mail, write, and quiet.

    -W minutes

    Specifies how often (in minutes) the fault alert will occur. If you don't specify this option, the alert is sent once.

    The fault alert setting is entered in the print server's /etc/lp/printers/printer-name/alert.sh file.

  3. Check the information following the On fault heading from the output of the following command.

    $ lpstat -p printer-name -l

Examples--Setting Fault Alerts for a Printer

The following example shows how to set up the printer mars to send fault alerts by email to a user named joe, with reminders every 5 minutes.

# lpadmin -p mars -A 'mail joe' -W 5

The following example shows how to sets up the printer venus to send fault alerts to the console window, with reminders every 10 minutes.

# lpadmin -p venus -A write -W 10

The following example shows how to stop fault alerts for the printer mercury.

# lpadmin -p mercury -A none

The following example shows how to stop fault alerts until the printer venus has been fixed.

# lpadmin -p venus -A quiet

Setting Up Printer Fault Recovery

If you choose not to send any fault notification, you can find out about printing faults so you can correct the problem. The LP print service will not continue to use a printer that has a fault. In addition to alerts for printer faults, you can also provide alerts that tell the system administrator to mount print wheels, font cartridges, and forms when print requests require them.

You can define the fault recovery options for a printer only by using the lpadmin -F command. This task is not available in Solaris Print Manager.

Printer faults can be as simple as running out of paper or needing to replace a toner cartridge. Other more serious problems can include complete printer failure or power failure. After you fix a printer fault, the print request that was active when the fault occurred begins printing in one of three ways:

  • Starts printing from the beginning

  • Continues printing from the top of the page where printing stopped

  • After you enable the printer, continues printing from the top of the page where the printing stopped

A print filter is required to continue printing from the top of a page where the printing stopped. A print filter records the control sequences used by the printer to track page boundaries, which the default filters used by the print service cannot do. You will be notified by the print service if recovery cannot proceed with the specified print filter. For information about writing filters, see "How to Create a New Print Filter".

If you want printing to resume immediately after a printer fault is fixed, enable the printer by using the enable command.

The following table lists the fault recovery values you can set for a printer with the lpadmin -F command.

Table 5-4 Values for Printer Fault Recovery

Value for -F recover-options

Description

beginning

After a fault recovery, printing restarts from the beginning of the file.

continue

After a fault recovery, printing starts at the top of the page where the printing stopped. This recovery option requires a print filter.

wait

After a fault recovery, printing stops until you enable the printer. After you enable the printer with the enable command, printing starts at the top of the page where printing stopped. This recovery option requires a print filter.

How to Set Printer Fault Recovery

  1. Log in as superuser, lp, or assume an equivalent role on the print server.

  2. Set up fault recovery for the printer.

    # lpadmin -p printer-name -F recovery-options

    -p printer-name

    Name of the printer for which you are specifying fault recovery.

    -F recovery-options

    One of the three valid recovery options:

    beginning, continue, or wait.

    For detailed information about the valid values for recovery-options, see Table 5-4.

    For more information, see lpadmin(1M).

    The fault recovery setting is entered in the print server's /etc/lp/printers/printer-name/configuration file.

  3. Check the information following the After fault heading in the output of the following command.

    $ lpstat -p printer-name -l
 
 
 
  Previous   Contents   Next