Operating System - HP-UX
1834806 Members
2945 Online
110070 Solutions
New Discussion

Installation of Printer's on Multiple Server's

 
SOLVED
Go to solution
harry_7
Frequent Advisor

Installation of Printer's on Multiple Server's

Dear All,

We have more than 20 server’s. For printing purpose we are using TCP/IP Printing. To configure all the printer’s we are using HPJET Direct software to configure to configure the printers.
Each time we have to add / (remove) a new printer on all the server’s. Time consuming job.

Is there any other way to manage this problem? Is there any third party software which can configure the printer on Unix Level as well as in the Oracle application. Please advise.

H
5 REPLIES 5
Bill Hassell
Honored Contributor

Re: Installation of Printer's on Multiple Server's

Dozens of printers can be setup on dozens of HP-UX systems in just a few seconds. Just use the addqueue command. The addqueue command needs just 2 parameters: the IP address and the local printqueue name. Just make a list of the printers by IP_addr and printqueue name (using the same printqueue name on each server is strongly recommended). The file would look like this:

12.34.56.78 prn37
23.45.67.89 prn38
...etc..

Then the script to read this file would be:

#!/usr/bin/sh
set -u
export PATH=/usr/bin:/opt/hpnpl/bin

cat /var/tmp/my_printer_list | while read IP PRNQUEUE
do
addqueue -q $IP $PRNQUEUE
done

and that's it. NOTE: the printers must be connected to the network and powered up, and they must be HP LaserJets. Non-HP printers and most HP DeskJets are not compatible with the JetDirect system. Remote print servers such as Windows and other Unix systems are not compatible with JetDirect software. Now you can script the adding of remote printers (in Windows terms, TCP/IP or Unix printers) using lpadmin, but with remote printers, all -o options (like -olandscape or -oduplex) are disabled.


Bill Hassell, sysadmin
eran maor
Honored Contributor
Solution

Re: Installation of Printer's on Multiple Server's

Hi

if bill hassell told to run a script , that need to be the answer , just to remind you that you can do all your job in one computer and then export the printer config. to a file , and then import it with another computer .

Execute
-> SAM
-> Printers and Plotters
-> Lp Spooler
-> Save/Restore Spooler Configuration

Choose
-> Actions
-> Save Spooler Configuration

This will save all the information necessary to rebuild the spooler into the
directory /var/sam/lp.

Tar this directory (/var/sam/lp) :

# tar cvf /tmp/lp.tar /var/sam/lp

Copy the resulting tar file, lp.tar, onto the target system.

Unpack the lp.tar file on the target system :

# tar xvf lp.tar


Execute
-> SAM
-> Printers and Plotters
-> Lp Spooler
-> Save/Restore Spooler Configuration

Choose
-> Actions
-> Restore Spooler Configuration

This will build the lp spooler configuration on the target system using the
information from the source system, creating a "clone" of the old system.
love computers
Bill Hassell
Honored Contributor

Re: Installation of Printer's on Multiple Server's

Eran's solution is the better one since it covers the entire spooing system, whether the printers are local, remote, or JetDirect. SAM is the way to go here.


Bill Hassell, sysadmin
Geoff Wild
Honored Contributor

Re: Installation of Printer's on Multiple Server's

You can also script it (without having to go into SAM):

/usr/sam/lbin/lpmgr -S -v -xsavedir=/var/sam/lp/
cp -r -p /var/sam/lp/lp.new/* /var/sam/lp/

tar cvf /tmp/lp.tar /var/sam/lp/
rcp /tmp/lp.tar serverB

On serverB:

lpshut

tar xvf /tmp/lp.tar

/usr/sam/lbin/lpmgr -R -xsavedir=/var/sam/lp/

lpsched -v

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
harry_7
Frequent Advisor

Re: Installation of Printer's on Multiple Server's

Dear All,

Thanks a lot for your efforts and valuable answer. It has solved my big problem.

Regards

Harry.