1833777 Members
2422 Online
110063 Solutions
New Discussion

Re: HP-UX Printer setup

 
SOLVED
Go to solution
James Bower
New Member

HP-UX Printer setup

This is an odd one. How do I tell how a print queue on the LP Spooler was initially set up? We have some older L2000 servers with several HP 4250 printers. The printers seem to be set up with the same settings. When we print a particular form from Oracle only one of the printers prints correctly. The queue that prints correctly was set up several years ago and originally had a different printer. When the printer was swapped out nothing on the print queue was changed. Is there any way to tell how this queue was originally set up? I assume that this is an obvious question to an experienced sysadmin. I am just an Oracle DBA.
6 REPLIES 6
Geoff Wild
Honored Contributor

Re: HP-UX Printer setup

Well, you can check the model scripts of each printer in /etc/lp/interface

See if they are the same.

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.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: HP-UX Printer setup

The first thing that I would do is make sure that each of the printers in question is set up as a "Network" printer as opposed to a "Remote" printer in HP-UX speak. You do this by issueing an "lpstat -v" command. Remote printers will contain an additional line: "remote to: xxx on aaa.bbb.ccc.ddd". I assume that the "good" printer is a Network printer. Now the fix is quite simple. We are going to copy the "good" interface files to the "bad".

Note: "good" and "bad" are the queue names in question.

cd /var/spool/lp/interface
cp -p bad bad.save
cp good bad
Now edit bad and look for a line
PERIPH=goodhostname_or_ipaddress
and change it to
PERIPH=badhostname_or_ipaddress
then save the file.

# You can look in bad.save if you don't know the old hostname

cd model.orig
cp -p bad bad.save
cp good bad

Now the behavior of "bad" should match that of "good". There is no need to stop and restart the spooler.

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: HP-UX Printer setup

Oh, I should add that should you discover that "bad" is a reomte printer and "good" is a Network printer then you should remove bad and add it back as a Network printer using hppi.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: HP-UX Printer setup

This isn't a simple task even for sysadmins. In HP-UX there are 3 types of printer setups: direct-connect by cable, either Centronics-style parallel or RS-232 serial, by remote print server such as WinNT, WinXP, or perhaps other Unix boxes, and for HP LAN cards, the hppi or 'network' connection. HP sells internal LAN cards for HP printers as well as external adapter boxes for use with HP and non-HP printers. These boxes are NOT the same as boxes from Netgear, Dlink, Lantronix, or other non-HP manufacturers.

For a direct connected printer (the printer is usually next to the computer because cables must be short), use the command:

lpstat -v

You'll see /dev/null for printers that are on the network but /dev/somethingelse for direct-connect printers. These are very uncommon because of the short cable lengths.

The easiest way to tell if the printer uses an HP LAN card is to run the hpnpadmin command as in:

hpnpadmin -v 12.34.56.78

(use your printer's IP address) If the program reports that it is an HP LAN card then it *may* have been setup with hppi (the preferred method) or as a 'remote' print server. To determine whether the printer was setup as a remote printer, cd to /etc/lp/interface and list the first 5 lines of each printer script:

cd /etc/lp/interface
head -10 *

For a remote printer, you'll see a line like this:

#Note: These options must be preceded by "BSD"

For an HP network printer, you'll see:

# $Header: /users/hpnp/odyssey/repository/sh/hpnp.model.psh

For a direct connected printer, there are dozens of possible printer scripts but you can use lpstat -v to see that a real device file is being used (not /dev/null as mentioned above).


Bill Hassell, sysadmin
James Bower
New Member

Re: HP-UX Printer setup

Thanks to all. I just learned more about HP-UX printing than I had in the past three years. For the most part I have simply used SAM, as my needs themselves are generally simple. This helped a lot, and I have gotten the printer working by rebuilding the errant queue.
James Bower
New Member

Re: HP-UX Printer setup

Needed to rebuild the bad queue. Thanks for help finding it.