Operating System - HP-UX
1836451 Members
2458 Online
110100 Solutions
New Discussion

Re: Remote Printers on HPUX

 
SOLVED
Go to solution
smookh
Occasional Advisor

Remote Printers on HPUX

Hi, a quick question.
On Solaris, I add an entry to the /etc/hosts file with the ip address and name of the remote printer. But on the HPUX box i'm working on now, the hostfile is almost empty, and yet there are about 20 remote printers activated on the machine. Where can I get the IP-Addresses for these printers ? They are all set up in /etc/lp/members, interface, sinterface, cinterface, etc. but I cannot find any address info there.

Thanks for your reply.

Smook
21 REPLIES 21
Brian Bergstrand
Honored Contributor

Re: Remote Printers on HPUX

The IP/DNS addresses of each printer are stored in the individual printer scripts in /etc/lp/interface. To create a new printer, use SAM.

HTH.
Ted Ellis_2
Honored Contributor

Re: Remote Printers on HPUX

sounds like the network printers may be found in DNS? Try the following to get printer info.

run lpstat -p to get a list of these 20 printer queue's...
run /usr/bin/hppi to open the JetDirect Printer Installer interface.. I am assuming here that this is what is on this machine.

now select 3 (diagnostics)... then 5 (view interface configuration.

Enter the printer queue name and you will get a listing of the interface set-up.. it will either show IP or network name...

Ted
Brian Bergstrand
Honored Contributor

Re: Remote Printers on HPUX

Forgot to mention the variable name. If you grep for "PERIPH" in /etc/lp/interface/*, then you will find each address.

HTH.
Michael Steele_2
Honored Contributor

Re: Remote Printers on HPUX

Here is the remote printer configuration procedure from HP, I've tested it on both versions of HP-UX; 10.20 and 11.00.
From client:
a) ps -ef | grep rlp
b) rlpdaemon running?
c) kill PID rlpdaemon
d) vi /etc/inetd.conf
e) printer stream tcp nowait root /usr/lib/rlpdaemon rlpdaemon -i -l (* THIS SYNTAX IS CORRECT*)
f) inetd -c
From both server and client:
a) vi /etc/hosts
b) add client/server ip
c) ping client/server ip
d) verify printer works for local print jobs on server
From server:
a) lpstat -t (* printer exists *)
b) /usr/lib/lpadmin -x printer (* NOW DELETE *)
c) /usr/lib/lpshut (* stop lpsched *)
d) /usr/lbin/lpadmin -p local_printer_name -mrmode1 -v/dev/null -ocmrcmode1 -osmrsmode1 -orm -orp
e) /usr/bin/enable local_printer_name
f) /usr/bin/accept local_printer_name
g) /usr/lib/lpsched
Support Fatherhood - Stop Family Law
Bryan D. Quinn
Respected Contributor

Re: Remote Printers on HPUX

Hello,

The way I do it is just to do something like this from the command line:

# grep PERIPH= /var/spool/lp/interface/qname

or

# grep PERIPH= /etc/lp/interface/qname

That will give you the ip address configured for that printer on that server.

Hope this helps!
-Bryan
Bryan D. Quinn
Respected Contributor

Re: Remote Printers on HPUX

Hello again,

Ok, please forgive me, my previous information I beleive will only work for JetAdmin configured printers. Sorry for the misinformation.

-Bryan
smookh
Occasional Advisor

Re: Remote Printers on HPUX

Thanks everybody for the quick responses, but i am still left with the same question.
As I said in my first mail, all the queue files in /etc/lp and /var/spool/lp..... etc. do not hold address information, no keyword called PERIPH in those files either.
lpstat -p gives me a list of queue names, but I knew those already. they don't give any ip information. The hppi tool shows me the list of queues set up on the machine, but when I try to get ANY info for ANY of the devices through one of hppi's options, it tells me the device doesn't exist. Any other suggestions ? Whenever I request for the printers to be setup up I give them the ip address and the printer brand / type, so they must be defined somewhere on the system.
john korterman
Honored Contributor

Re: Remote Printers on HPUX

Hi,
the printers are probably configured via SAM -->Printers and Plotters ->LP Spooler ->Printers and Plotters.
They can be configured directly with an ip-adress or by an alias in /etc/hosts; check the above SAM entry for the method.

You can also get a quick overview of the remote printers by executing:
# lpstat -s

if the remote printers have been configured via the above mentioned SAM entry with ip-address, the ip-adress will also appear here, e.g.:
remote to: on
or you should see an alias from /etc/hosts for print_server (we assume that the printer can actually print).

The limited number of entries in /etc/hosts could also be explained by the fact that the unix printers may reside on the same print_server. It will be clear from the lpstat -s command.

regards,
John K.


it would be nice if you always got a second chance
smookh
Occasional Advisor

Re: Remote Printers on HPUX

Hi again.
Thanks John, you did get me a few steps closer. lpstat -s does show the ip address, but I still don't know WHERE it get's this information from. I added a new remote printer with SAM and it worked, but do you know WHERE on the filesystem there maybe a file which stores all this SAM information for printers (hosts is definitely empty).
Smook
Jeff Schussele
Honored Contributor

Re: Remote Printers on HPUX

Hi Smook,

Yes it's stored in a file....
I'll give you a hint, it's stored binary - hence no grep search will help.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Remote Printers on HPUX

Well....I'l qualify that.
A *properly* constructured grep search would.

Cheers,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Remote Printers on HPUX

Anybody??

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: Remote Printers on HPUX

Quiet out there...

/var/spool/lp/pstatus

Sorry, no winners tonight - try again tomorrow....

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
smookh
Occasional Advisor

Re: Remote Printers on HPUX

Thanks Jeff, though I don't see what calls for the 'dodgyness', I have grepped the /etc/lp/pstatus file and indeed, all the ip addressess came out. Then I tried the same with a strings -a and the same happened. Now tell me Mr. Brain, how can I edit this file (or other files needed as well) so I can add a printer without having to use the SAM tool ?

Smook
Jeff Schussele
Honored Contributor
Solution

Re: Remote Printers on HPUX

Sheesh Smook, lighten up. Just trying to have some fun & oh yea - help YOU at the same time. Maybe I should have reconsidered...the latter.
It's awfully easy to sit behind an alias & lob insults.

But as you've pointed out, I am a thinking man & think you may have misunderstood. So I'll dodge your jab and suggest that you man the lpadmin command which gives you all the options you'll need to create/modify/delete a printer w/o using SAM.

Now there'e your bait, go fish.

Regards,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Michael Steele_2
Honored Contributor

Re: Remote Printers on HPUX

Again...

Here is the remote printer configuration procedure from HP, I've tested it on both versions of HP-UX; 10.20 and 11.00.
From client:
a) ps -ef | grep rlp
b) rlpdaemon running?
c) kill PID rlpdaemon
d) vi /etc/inetd.conf
e) printer stream tcp nowait root /usr/lib/rlpdaemon rlpdaemon -i -l (* THIS SYNTAX IS CORRECT*)
f) inetd -c
From both server and client:
a) vi /etc/hosts
b) add client/server ip
c) ping client/server ip
d) verify printer works for local print jobs on server
From server:
a) lpstat -t (* printer exists *)
b) /usr/lib/lpadmin -x printer (* NOW DELETE *)
c) /usr/lib/lpshut (* stop lpsched *)
d) /usr/lbin/lpadmin -p local_printer_name -mrmode1 -v/dev/null -ocmrcmode1 -osmrsmode1 -orm -orp
e) /usr/bin/enable local_printer_name
f) /usr/bin/accept local_printer_name
g) /usr/lib/lpsched
Support Fatherhood - Stop Family Law
smookh
Occasional Advisor

Re: Remote Printers on HPUX

Jeff,

Sorry dude, didn't mean to offend you.
Thanks for your answer.

But, doesn't the lpadmin command need an entry in the hostfile for remote printers, or does it use the same method as the SAM tool ?

Cheers,

Smook
smookh
Occasional Advisor

Re: Remote Printers on HPUX

By the by,

Smook is my last name, not an alias. My name is Harm Smook if you prefer that. I have nothing to hide.

Harm
Jeff Schussele
Honored Contributor

Re: Remote Printers on HPUX

Hi Harm,

Interesting name - love it.
No, I'm not offended & I also meant no offense. Just holding my own - as we're all apt to do. I guess maybe we got off on the wrong foot & I apologize for my part. But I look forward to your further posts & wish to warmly welcome you to the forum. You have entered THE best forum on the planet & we need new blood just like any society.

Now to the question at hand...

*Only* lp devices designated by hostname - not IP - need hosts file entries. So if you put it in by IP it won't need the lookup.

Best Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Bill Hassell
Honored Contributor

Re: Remote Printers on HPUX

The lack of IP addresses in /etc/hosts is VERY likely an indicator that DNS is used on this machine. Whether /etc/hosts is even used at all is controlled by /etc/nsswitch.conf. If this file does not exist and there is a file called /etc/resolv.conf, then this machine uses a DNS server for everything. If nsswitch.conf does exist, then the rules for "hosts:" will tell you how DNS and /etc/hosts (aka, files) will work.

All that said, you can add a remote printer with an address OR a hostname. lpadmin doesn't care. /var/spool/lp/pstatus is the file which containes the printer names and IP/hostnames for remote servers. But this is totally useless information to add a remote printer. You can use SAM (which very easy) or you can use lpadmin which is what SAM uses. It would be a simple command like:

/usr/sbin/lpadmin -plp3 -v/dev/null -mrmodel -ocmrcmodel -osmrsmodel -ob3 -orm12.34.56.78 -orplp -v/dev/null

Simple, eh? (this example is right out of the man page for lpadmin). To see the IP addresses that lp is using for printing, just use: strings /var/spool/lp/pstatus. Note that this is a binary file and the format is not available publicly without a source code license. Bottom line: you don't need anything in /etc/hosts to add a remote printer if you use the IP address as the remote hostname.


Bill Hassell, sysadmin
smookh
Occasional Advisor

Re: Remote Printers on HPUX

Thanks for the explanation Bill and everyone else who answered, I appreciate the effort. I probably cannot teach you or any of the guys in this forum anything about HPUX, but should you have any Oracle / Oracle Applications / MickeyMouse (MS)/ Intel / related questions, please feel free to ask....

Harm