Operating System - HP-UX
1751922 Members
4729 Online
108783 Solutions
New Discussion юеВ

Re: HP-UX Jetadmin in Batch mode

 
SOLVED
Go to solution
Thomas Bahr
Occasional Contributor

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
5 REPLIES 5
Frederic Sevestre
Honored Contributor

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 ?
Frederic Sevestre
Honored Contributor

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 ?
Tony Willis_1
Frequent Advisor

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"
Bill Hassell
Honored Contributor
Solution

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.


Bill Hassell, sysadmin
Thomas Bahr
Occasional Contributor

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 ;-)