Operating System - HP-UX
1822146 Members
4294 Online
109640 Solutions
New Discussion юеВ

Re: Changing Remote Printer Host

 
James D. Bennett
Occasional Contributor

Changing Remote Printer Host

Hi!

I have several remote printers that are running on an NT sever. I am trying to find a way to write a script that will switch all of those printers so that instead of pointing to server 'A' they will point to sever 'B'. We need this for failover. I though I could use the lpadmin command but the command runs but it does not make the changes.

Thanks for your help..
5 REPLIES 5
Steve Steel
Honored Contributor

Re: Changing Remote Printer Host

Hi

From lpadmin man


Assuming a printer lp on a remote system system2, the command:

/usr/sbin/lpadmin -plp3 -v/dev/null -mrmodel -ocmrcmodel
-osmrsmodel -ob3 -ormsystem2 -orplp -v/dev/null

causes the spool system to use the local line printer lp3 and the
model rmodel. The spool system also uses the model rcmodel to cancel
remote requests and rsmodel to get status from system2. In addition,
the three-digit sequence numbers, the remote system name system2 and
the remote printer lp are used.

If you want to move a printer for fallover either make 2 printers.
1 on each machine and look at class

members of class belgo161:
belgo046

Disable and reject the printer you do not want
and all requests with lp -dclass go to the available one.


Or make a script to remove the printer s and remake on the other machine.

You cannot alter the host on an existing printer


Steve Steel

If you want truly to understand something, try to change it. (Kurt Lewin)
Sachin Patel
Honored Contributor

Re: Changing Remote Printer Host

Hi James
First you have to remove printer then you can configure to server B.
There can't be one printer point to two server.

Attached is the script that I uses to remove and add printers.

#./printer -remove printername
#./printer -add server_name printername_on_server local_name

Sachin
Is photography a hobby or another way to spend $
Sachin Patel
Honored Contributor

Re: Changing Remote Printer Host

Hi James
First you have to remove printer then you can configure to server B.
There can't be one printer point to two server.

Attached is the script that I uses to remove and add printers.

#./printer -remove printername
#./printer -add server_name printername_on_server local_name

Sachin
Is photography a hobby or another way to spend $
MANOJ SRIVASTAVA
Honored Contributor

Re: Changing Remote Printer Host

Hi James

You can use a mock move of printers using sam , this will genrate files under /var/sam/lp
which be compressed and kept in the otehr system , once the failover takes place you can just reinstall these printers using sam after uncompressing the moverd files .



Manoj Srivastava
Tom Dawson
Regular Advisor

Re: Changing Remote Printer Host

James,

I'm a little confused where you say "instead of pointing to server 'A' they will point to sever 'B'". I usually think of the Print Server "pointing" to a printer instead of the other way around. But that's probably just semantics.

Let's say you have a printer, "ptr_a_1" configured on a NT print server, "srvr_a". Your HP-UX lp system knows it as "ptr_a_1 on srvr_a". For failover, you could configure the same printer on a second NT print server, "srvr_b". Then, on your HP-UX lp system, you configure that printer as "ptr_b_1 on srvr_b". Put both ptr_a_1 and ptr_b_1 in the same printer class. Simply leave ptr_b_1 in a disabled state. And have your print jobs going to the "class" instead of a specific printer.

When whatever event occurs that causes you to need to failover, execute a script that disables ptr_a_1, and enables ptr_b_1. Now, your HP-UX server is sending print jobs to srvr_b instead of srvr_a.

The scritp is easy:

disable ptr_a_1
enable ptr_b_1

The real work will be in analyzing and configuring your printer classes.

HTH,
Tom