Operating System - HP-UX
1833038 Members
2407 Online
110049 Solutions
New Discussion

Re: HPPI and printer name

 
Garyphoenixcontact
Occasional Contributor

HPPI and printer name

Does anyone know why my HPPI adds and _1 to the end of each printer that I add. After doing so, I need to go back into the configuration and rename the printer to its original name with the _1.

example: mfg_sac_hp4100_l when adding printer

need to go into config(1) and change to mfg_sac_hp4100

Just a bit of a nuisance, but was wondering why this happens.

Thanks!
4 REPLIES 4
A. Clay Stephenson
Acclaimed Contributor

Re: HPPI and printer name

It's rather easy to correct in the underlying scripts but the reason is fairly simple. Consider setting up the same physical printer as multiple logical printers with different default settings. Possibly _1 as portait, _2 as landscape, _3 as duplex from tray 3, ... . The automatic appending of the digits avoids queue name collision. It's rather dumb and a smarter play would be to see if the unappended name conflicts before appending. In fact, I remember posting a "fix" for this long ago. In any event, the easy answer is to not use hppi but instead use the addqueue command. Man addqueue for details.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: HPPI and printer name

I went back and found my original posting and updated it to JetDirect rather than Jetadmin. If my poor memory serves, this response was my first Bunny on the Forums.

---------------------------------------------

1) Locate the file /opt/hpnpl/admin/option6hp
and make a backup copy just in case.

2) Edit the file and find the string 'aNAME'.
Locate the line aNAME="`echo $QBASENAME | "$SED" 's/-/_/g'"_"$i".
Precede this line with the following:
aNAME=${QBASENAME}
if [ ${i} -gt 0 ]
then
original line goes here
followed by fi

3) Locate the enclosing while [ 0 ] statement; the line above should be changed from
i=1
to
i=0.

That's it.

The condition prevents a hang in case more than one queue is being assigned to the same IP node. If a duplicate is found then the default behavior kicks in.

-----------------------------------------
Of course, it's still easier to simply use addqueue but if the interactive add bothers you this the above hack will fix you.
If it ain't broke, I can fix that.
Garyphoenixcontact
Occasional Contributor

Re: HPPI and printer name

Mr Stephenson

Thanks for the script change!
It worked like a charm!

Very good info.
Bill Hassell
Honored Contributor

Re: HPPI and printer name

The reason that _1 is added has been criticized for more than a decade. The reason was just a bad choice by a programmer long ago (back when hppi was called jetadmin).

You can avoid all of this junk by simply using the command line (and a it's a lot faster):

addqueue -h 12.34.56.78 -q mfg_sac_hp4100

wherr -h is the IP address. Note that I prefer using IP addresses for printers because so many DNS admins fail to add printer hostnames in a timely manner.


Bill Hassell, sysadmin