1837900 Members
3346 Online
110123 Solutions
New Discussion

Re: network printer

 
SOLVED
Go to solution
KathyK
Regular Advisor

network printer

Hi gurus,

I have a few questions regarding network print queue on hpux11.23.

1. using "lpstat -t" I get:

device for fjet2_1: /dev/null
fjet2_1 accepting requests since Jan 8 09:08

printer fjet2_1 is idle. enabled since Jan 8 09:08
fence priority : 0


but when I ping or nslookup the printer name this is what I get and also we can't print to the printer:

# nslookup fjet2_1
Using /etc/hosts on: simpk400

looking up FILES
Trying DNS
*** sadc1.stec-inc.ad can't find fjet2_1: Non-existent domain


Is it correct to assume that this printer is configured but not on the network?



2. I don't quite understand how the print queue and printer name work for example:

#lpstat -t
device for jet11_1: /dev/null
jet11_1 accepting requests since Jan 8 09:08
printer jet11_1 is idle. enabled since Jan 8 09:08

but the printer name is:


looking up FILES
Name: jet11
Address: 172.17.4.50

and not:

# nslookup jet11_1
Using /etc/hosts on: simpk400

looking up FILES
Trying DNS
*** sadc1.stec-inc.ad can't find jet11_1: Non-existent domain

Please explain.


Thank you in advance for any assistance.

Kathy

10 REPLIES 10
Tim Nelson
Honored Contributor
Solution

Re: network printer

The queue name and the IP/Hostname of the printer have absolutely nothing in common unless you chose to name them exactly the same.

Network based printers ( those with some type of jetdirect or equivelant ) IP information is found in the interface file for the printer.

So in this case:
grep PERIPH= /etc/lp/interface/jet11_1

PERIPH with either be set to an IP address or a hostname found in /etc/hosts.

KathyK
Regular Advisor

Re: network printer

Thank you Tim.
Bill Hassell
Honored Contributor

Re: network printer

A bit of advice about printers -- don't use hostnames. In most data centers, keeping printer hostnames up to date on the DNS server is never a priority. Add your printers with IP addresses. If those printer IPs keep changing, you've got bigger problems with your network administrators.

lpstat provides no information about the destination printer, only status for the local print queues.

There are two very different ways to connect a printer and unfortunately, lpstat won't tell you the difference. One method is where the printer is served by some other computer (a PC, Linux, non-HP LAN card) and this is called a remote printer. A remote printer has no -o options making it quite awkward to use.

The other printer (mentioned above) is a network printer (SAM's wording) and connects directly to HP-UX. All the "network" printers are listed in the /etc/lp/interface/model.orig directory. If model.orig does not exist, all your printers are "remote" (or connected with cables). With "network" printers (virtually all will be HP) you can use hpnpadmin -v IP.address to find details.

In either case, there is a print queue name which is what you use with the lp command. Whether the printer was added with a hostname or IP address is irrelevant.


Bill Hassell, sysadmin
KathyK
Regular Advisor

Re: network printer

Bill,

thank you great pointers. unfortunatly all the printers are in fact network and been added using names. allot of them i'm told are no longer in service or the ip has changed and my project is to cleanup the spooler on this system.
Bill Hassell
Honored Contributor

Re: network printer

Great. Network printers are very easy to delete/add using the addqueue and removequeue command. Start by using the reject command on all the printers you know are not working or unused. You can work on them if any users complain. Don't use disable as this allows the printers to collect jobs whereas reject prevents the job from being submitted (immediate feedback). After a few weeks, just use lpadmin -x to remove them.

Make sure /opt/hpnpl/bin is in your PATH. Then use hpnpadmin to see if a particular printer responds. ping is not always a reliable test depending on how your network is managed. For the rest of the printers, I would delete and re-add each one of them. The reason is that they may not have been added with the right printer script. hpnpadmin -v will tell you everything about the printer and you can download the correct script from: http://www.hp.com/pond/modelscripts/index2.html

Then, use removequeue -q prn_queue followed by:

addqueue -h 12.34.56.78 -q prn_queue -t off -b off -r off

You can batch all these addqueue's together and remove/add them at one time with the spooler stopped. Each remove/add will take 2-5 seconds. And now you'll have only the working printers with the latest printer scripts.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: network printer

>my project is to cleanup the spooler on this system.

Just the one or all systems? Do you use NIS?
We use a NIS map for printers so all systems can be made the same:
$ ypcat -k printers
colorlj1 adlprt01
...

And have a simple script that deletes all printers and adds only those back.
KathyK
Regular Advisor

Re: network printer

Bill/Dennis,
thank you both.

the printers are on one system. i don't think we are using nis for them. but any script would help.

best regards,
kathy
Dennis Handly
Acclaimed Contributor

Re: network printer

>But any script would help.

What you need is a table of IP and printer names. Once you have that, it should be a simple matter to execute Bill's addqueue on each entry.
while read PRINTER IP JUNK; do
removequeue -q $PRINTER # remove old
addqueue -h $IP -q $PRINTER -t off -b off -r off
done < printer_table
KathyK
Regular Advisor

Re: network printer

Thank you, for your help. I'm closing this thread.
KathyK
Regular Advisor

Re: network printer

closed