The print service provides a method for detecting and alerting you to printer faults. Faults can range from simple problems, such as running out of paper, ribbon, or toner, to more serious faults, such as a local power failure or printer failure. The range of fault indicators is also broad, ranging from dropping the carrier (the signal that indicates that the printer is online) to sending an XOFF or a message.
The print service itself only recognizes two classes of printer fault indicators: ``hangups'' (a loss of carrier) and excessive delays in printing (an XOFF flow-control character without a matching XON). For faults other than these, the printer service cannot determine the cause of the fault, so it cannot alert you. However, you can add filters that can detect other printer faults and inform the print service, which in turn alerts you. See ``Task 3: detecting printer faults''.
To arrange for the print service to issue an alert
in the event of a printer fault,
enter one of the following commands:
/usr/sbin/lpadmin -p printer-name -A mail -W minutes
/usr/sbin/lpadmin -p printer-name -A write -W minutes
/usr/sbin/lpadmin -p printer-name -A 'command' -W minutes
The first two commands direct the print service to send you a mail message or write the message directly to your terminal, respectively, for each alert. The third command directs the print service to run the command for each alert. The shell environment currently in effect when you enter the third command is saved and restored for the execution of command. The environment includes environment variables, user and group IDs, and current directory. The minutes argument is the number of minutes between repeated alerts.
If you do not want the
print service to issue an alert
when a fault occurs, enter the following:
/usr/sbin/lpadmin -p printer-name -A none
If you want mail sent or a message written to another user when a printer fault occurs, use the third command with the option -A 'mail login-ID' or -A 'write login-ID'. If you do not specify a login-ID, the mail or message will be sent to your current login name. This may not be your login if you have used the su(1M) command to change it.
Once a fault occurs
and you start receiving repeated alerts,
you can direct the
to stop sending you alerts (for the current fault only),
by executing the following command:
/usr/sbin/lpadmin -p printer-name -A quiet
If the printer-name is all in any of the commands discussed, the alerting condition will apply to all printers.
If you don't define an alert method, you will receive mail once for each printer fault. If you define a method without the -W option, you will be alerted once for each fault.