Operating System - HP-UX
1825601 Members
2670 Online
109682 Solutions
New Discussion

Batch network printer installation

 
Francis Hwang
Occasional Advisor

Batch network printer installation

I need the command to install network printer from HP-UX. I have over two hundreds of them. I want to use a batch file to do this. What is the right lpadmin options I need to use to a HP 4si and a LexMark M412n printer. Thanks in advance!
cdhill
6 REPLIES 6
S.K. Chan
Honored Contributor

Re: Batch network printer installation

# lpadmin -p -v -m# accept
# enable

Look for the model script in /usr/lib/lp/model.
Francis Hwang
Occasional Advisor

Re: Batch network printer installation

I apologize that I didn't explain very clear at first. These are all network printers which all have their own network card and IPs. I know you can do it through JetAdmin . But for over two hundred printers, batch job seems to be the right way to do it. Thanks again!
cdhill
S.K. Chan
Honored Contributor

Re: Batch network printer installation

To add a Jetadmin printer from command line, use this :-

# addqueue [-c class] [-d] [-i printerID] -h hostname -q queuename -p port

Do a "man addqueue" for details. You could probably write a simple script to loop the above to all the printers.
D. Jackson_1
Honored Contributor

Re: Batch network printer installation

You might give this scripts a shot.

First collect all the printer names and put them in a file (p-queues)

#!/bin/ksh
> added.log
for i in `cat p-queues`
do
echo $i
addqueue -q$i -h$i >> added.log 2>&1
done

Run that a few times and see if it gets all of your printers.
It is not guranteed to work but it has worked for me in the past.


Good luck
Bill Hassell
Honored Contributor

Re: Batch network printer installation

Really easy (IF they are both JetDirect connected). To see if they are JetDirect printers, use the command:

/opt/hpnp/bin/hpnpadmin -A

It will either say:

*** Receive NO snmp response!
*** (printer down, cable off, or wrong Get community name?)

or

is a network printer

The first reply indicates that the IP-address is not an HP JetDirect network card, so it can't be configured in batch mode.

So the command line is:

/usr/hpnp/bin/addqueue -h -q queuename

Repeat as many times as needed...


Bill Hassell, sysadmin
Francis Hwang
Occasional Advisor

Re: Batch network printer installation

Thanks guys. The hpnpadmin command works. But I wonder how to tell the difference between HP4si and LexMark M412n network printer? I mean, if you use lpadmin, don't you need to specify -orm -ocm -osm or -m options? Addqueue command doesn't tell any difference between any models. Any more input will be greatly appreciated!
cdhill