Operating System - HP-UX
1836612 Members
2920 Online
110102 Solutions
New Discussion

Re: Adding printer remotely in 10.20

 
Jonathan Wegner
Occasional Advisor

Adding printer remotely in 10.20

I want to add printers to workstations via a script from my server. I've experimented with this already using lpadmin and by attempting to copy a print file to the remote host.

With lpadmin I get an error that the device file can't be created, if the system already has a printer in place then this error does not occur.

The commands I'm using are remsh, rcp, and as mentioned before, lpadmin.

Here is my command structure.

remsh hostname "/usr/sbin/lpadmin -p printer name -v/dev/c2t0d0 -mdumb"


Any suggestions? Am I attempting the impossible?

4 REPLIES 4
David Navarro
Respected Contributor

Re: Adding printer remotely in 10.20

Hi, if you do login to remote workststaion as root and executes that command??
What happens? Does it works?
Jonathan Wegner
Occasional Advisor

Re: Adding printer remotely in 10.20

If I do an rlogin as root and try to execute the lpadmin command I get a "can't access file "c2t0d0_lp"" error.

If I login into the workstation directly and execute the command from a the root prompt I don't get the error.

The full command is:
lpadmin -pmdslp -v/dev/c2t0d0_lp -mdumb
linuxfan
Honored Contributor

Re: Adding printer remotely in 10.20

Hi Jonathan,

To add a remote printer you can use a command called addque (/opt/hpnp/bin/addqueue)

do a manpage for addqueue. you can script it very easily.

For example if you have a HP laserjet(5m)
the model number is 15 (addqueue -l to different model numbers), the ip address of the printer is xxx.xxx.xxx.xxx and the queuename you want to use is queue1, you would do something like

addqueue -i 15 -h xxx.xxx.xxx.xxx -q queue1

-HTH
I am RU
They think they know but don't. At least I know I don't know - Socrates

Re: Adding printer remotely in 10.20

Hi,

In theeach user's $home/directory has to create the file ". rhosts." In the same one you have to place the names of your remote servers, and this way you rot to carry out "rcp", "remsh", and "lp" or "lpadmin."

Example.
"server number 2"
cd / home/jhon
vi .rhosts
hosts1
* * * * * * * * * * * * * * * * * * * * * * * * * * * +
"servant numbers 1"
cd / home/jhon
vi .rhosts
hosts2
Orlando Oliveira