UnixPedia : HPUX / LINUX / SOLARIS: Adding a Remote Printer

Saturday, January 19, 2013

Adding a Remote Printer


Some systems are connected with lots of printers. To collect the status of a printer use the next command:

# lpstat -t
# lpstat -t | grep printer

After the listing of printers and status ‘lpstat’ also generates an overview of details per printer. This takes a wile. When necessary, you can stop the output with CTRL-C.

To add a new printer use the next command:

# lpadmin -pprinter -v/dev/null -mrmodel -ocmrcmodel -osmrsmodel -ob3 -ormX –orpY
 
·       Printer is the local printer name
·       X is the name of the remote system. This name and the linked IP address is defined in /etc/hosts or in DNS. The printer-name can be choosen, but must be unique!
·       Y is the name of the printer on the remote system. This must be mentioned in the ticket. In /etc/hosts or in DNS  all remote printers must be indicated with a rule with name and IP address.

For example:
 
161.89.57.148           A029  # printer A029 remote: LMS0FASAP400

# lpshut
# lpadmin -pA029  -v/dev/null -mrmodel -ocmrcmodel -osmrsmodel -ob3 -ormA029 -orpLMS0FASAP400
# accept A029 
# lpsched
# lpstat -t|awk '/A029/'
# enable A029 
# lpstat -t|awk '/A029/'
note: the reverse command of accept is reject

Status check of printer :
lpstat -o<Qname>
lpstat -p<Qname>
lpstat -a<Qname>
lpstat -r <lpsched process is running >

Log file for printer :

tail -f /var/adm/lp/log

For remoter printer 515 port should be working for connection :

telnet <printer IP> 515
<op>


1 comment: