Re: HP-UX Jetadmin in Batch mode (96 Views)
Reply
Occasional Contributor
Thomas Bahr
Posts: 4
Registered: ‎12-01-1999
Message 1 of 6 (96 Views)
Accepted Solution

HP-UX Jetadmin in Batch mode

Hello,
I've the problems to generate printer queue on a new HP-UX servers from an existing one with jetadmin. Modelscripts are available /etc/hosts is prepared. Can I use jetadmin 11D621 in batch or script mode ? The steps in illustration attachment should go automatically
Honored Contributor
Frederic Sevestre
Posts: 272
Registered: ‎11-30-1999
Message 2 of 6 (96 Views)

Re: HP-UX Jetadmin in Batch mode

Hi,

I think you can't use a file under jetadmin.
But you can prepare a answers file for jetadmin :

File LIST looks like :
IP1:NAME1
IP2:NAME2
...

Then in a script :

# Prepare the file
echo "1" > jetadmin_global
cat LIST | while read LINE
do
IP=`echo $LINE | cut -d: -f1`
NAME=`echo $LINE | cut -d: -f2`
cat <<-% >> jetadmin_global
3
$IP
1
$NAME
5
q
0
y
%
fi
done
echo "q" >> jetadmin_global
echo "q" >> jetadmin_global

# Creation des imprimantes
/opt/hpnp/bin/jetadmin < jetadmin_global > jetadmin_global.log
lpsched
lpstat -a

It should work.

The other way is to save the spooler on the first server :
# /usr/sam/lbin/lpmgr -S -xsavedir=/var/sam/lp
Transfert the directory /var/sam/lp on the other server :
# tar cf - /var/sam/lp | rexec server2 "tar xvf -"

Then on the server 2, restore the spooler :
# /usr/sam/lbin/lpmgr -R -xsavedir=/var/sam/lp

Regards,
Fr??d??ric



Crime doesn't pay...does that mean that my job is a crime ?
Honored Contributor
Frederic Sevestre
Posts: 272
Registered: ‎11-30-1999
Message 3 of 6 (96 Views)

Re: HP-UX Jetadmin in Batch mode

Hi,

I think you can't use a file under jetadmin.
But you can prepare a answers file for jetadmin :

File LIST looks like :
IP1:NAME1
IP2:NAME2
...

Then in a script :

# Prepare the file
echo "1" > jetadmin_global
cat LIST | while read LINE
do
IP=`echo $LINE | cut -d: -f1`
NAME=`echo $LINE | cut -d: -f2`
cat <<-% >> jetadmin_global
3
$IP
1
$NAME
5
q
0
y
%
fi
done
echo "q" >> jetadmin_global
echo "q" >> jetadmin_global

# Creation des imprimantes
/opt/hpnp/bin/jetadmin < jetadmin_global > jetadmin_global.log
lpsched
lpstat -a

It should work.

The other way is to save the spooler on the first server :
# /usr/sam/lbin/lpmgr -S -xsavedir=/var/sam/lp
Transfert the directory /var/sam/lp on the other server :
# tar cf - /var/sam/lp | rexec server2 "tar xvf -"

Then on the server 2, restore the spooler :
# /usr/sam/lbin/lpmgr -R -xsavedir=/var/sam/lp

Regards,
Fr??d??ric



Crime doesn't pay...does that mean that my job is a crime ?
Frequent Advisor
Tony Willis_1
Posts: 53
Registered: ‎11-22-1998
Message 4 of 6 (96 Views)

Re: HP-UX Jetadmin in Batch mode

I suggest dropping jetadmin and using HPPI.
JetAdmin and WebJetAdmin are now designed for Windows systms and are dogs on unix.
HPPI works and is easily updated.
The transder_queues command is excellant in maintaining print queues among multiple systems.

Model scripts under the HP-UX approved JetAdmin did NOT always add-in as expected.
I have had no problem with HPPI.


Tony
"Not Today,Nice Try, Next Time"
Honored Contributor
Bill Hassell
Posts: 14,226
Registered: ‎05-29-2000
Message 5 of 6 (96 Views)

Re: HP-UX Jetadmin in Batch mode

JetAdmin and HPPI both have the required batch command:

addqueue

Just create a script with the queuename and the host or IP address as in:

/opt/hpnpl/bin/addqueue -q printqueue_name -h hostname

Repeat as needed. With the (long) obsolete JetAdmin, the path is /opt/hpnp/bin/addqueue. If you need more options, look at multiaddqueue. There are man pages for all the batch commands:

addqueue
multiaddqueue
removequeue
multiremovequeue
transferqueue

Note that with the batch commends, the printer must be turned on and connected to the LAN so it can be queried as to model number. The printer does not have to be online, just powered up.
Occasional Contributor
Thomas Bahr
Posts: 4
Registered: ‎12-01-1999
Message 6 of 6 (96 Views)

Re: HP-UX Jetadmin in Batch mode

Dear all,
many ThanX for this answers, these are exactly the hints
I need I will test, if I have further infos I will come back.
You are TOP ;-)
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.