1832592 Members
2740 Online
110043 Solutions
New Discussion

Re: Remoteprinting

 
SOLVED
Go to solution
Lothar Krueler
Regular Advisor

Remoteprinting

Hi there,
how can I print on a remote system without configuring a local printspooler? Is there a simple possibility like 'lp -d prn1@remotehost file' or do i have to pipe the file to a remsh command ?
Thanks in advance
Lothar
Wissen macht zaghaft, Dummheit kann alles!
12 REPLIES 12
Chris Wilshaw
Honored Contributor

Re: Remoteprinting

Lothar,

You'd have to use the remsh option if you didn't have a printer set up locally.


cat file | remsh remotehost "lp -dprinter"
Robert-Jan Goossens
Honored Contributor

Re: Remoteprinting

Hi,

# lp -d printserver:printername file

Kind regards,

Robert-Jan.
Lothar Krueler
Regular Advisor

Re: Remoteprinting

Hi Chris, Hi Robert-Jan,
thanks. I think the remsh command will work.
But ther must be an easier way.
Robert-Jan , please take a look at my tests:
The nodes are Zeus and Hera, the printer is p2218 at zeus. OS=HP-UX 11.0

(rlogin from hera to zeus)
zeus:/root# lpstat -pp2218
printer p2218 is idle. enabled since Dec 13 11:12
fence priority : 0
zeus:/root# remsh hera '/usr/bin/lp -dzeus:p2218 /etc/fstab'

/usr/bin/lp: Ziel "zeus:p2218" existiert nicht
zeus:/root# remsh hera '/usr/bin/lp -d zeus:p2218 /etc/fstab'

/usr/bin/lp: Ziel "zeus:p2218" existiert nicht

zeus:/root# exit
logout root
Connection closed.

hera:/# /usr/bin/lp -dzeus:p2218 /etc/fstab
/usr/bin/lp: destination "zeus:p2218" non-existent
hera:/#

Do I have to enable any additonal service ?

Wissen macht zaghaft, Dummheit kann alles!
Steve Steel
Honored Contributor

Re: Remoteprinting

Hi

The only good way to do this is to generate a remote printer with sam from one to the other.

It does not slow the system and you are making it more complicated than needed this way.

Or a script where there is no printer.

Which

1)Copies the file to the other machine on /tmp as a temporary file
2)remsh to print it
3)remsh to remove it.

cat|remsh if the file has any size is not a great solution.

Regards

Steve Steel

Quote of the moment
-------------------
"We are drowning in information but starved for knowledge."
-- John Naisbitt
If you want truly to understand something, try to change it. (Kurt Lewin)
Robert-Jan Goossens
Honored Contributor

Re: Remoteprinting

Hi Lothar,

My mistake, I used the lp command on a solaris server.

-d destination
Prints file on a specific destination. Destination
can be either a printer of a class of printers, (see
lpadmin(1M)). Specify destination using atomic,
POSIX-style (server:destination), or Federated Naming
Service (FNS) (.../service/printer/...) names. See
printers.conf(4) for information regarding the naming
conventions for atomic and FNS names, and standards(5)
for information regarding POSIX.

Kind regards,

Robert-Jan.
Lothar Krueler
Regular Advisor

Re: Remoteprinting

Hi Steve, thank you, i'll have to use your suggestion if i won't find another way. But there must be one - if not the use of dedicated printservers connected to several application servers wouldn't make sense, because each printer that should be used by any user on any host must be configured at atleast one app-server AND at the printserver. So each printjob is spooled twice and there are at least 2 spooler to administrate each printer.

Hi Robert-Jan, thanks again, but I have difficulties in getting information about 'printers.conf'. I could find neither any hint at the manpages nor the file itself.
Wissen macht zaghaft, Dummheit kann alles!
Armin Feller
Honored Contributor

Re: Remoteprinting

To configure a remote printer into the lp spooling system:

1. Add the following entry to the /etc/inetd.conf file on the
printer host system:

printer stream tcp nowait root /usr/lib/rlpdaemon rlpdaemon
-i -1

2. Execute the "inetd -c" command.

3. Add the host printer to the remote system:

/usr/lib/lpadmin -plp -v/dev/null -mrmodel -ocmrcmodel
-osmrsmodel / -orm -orplp

/usr/lib/lpadmin -dlp
/usr/lib/accept lp
/usr/bin/enable lp
/usr/lib/lpsched

Note: In the above command, is the host system of the
printer, and lp is the name of the printer (remote and
local in this example '-p lp and -orp lp'). The remote
and local printers can have the same name, or they can
have a different name. However, it is easier to
troubleshoot if you use the same name.

4. Execute the following command to verify the setup:

/usr/bin/lpstat -t
Armin Feller
Honored Contributor

Re: Remoteprinting

1. Set up the printer as a local printer with SAM:

SAM ->
Printers and Plotters ->
LP Spooler ->
Printers and Plotters ->
Actions ->
Add Local Printer/Plotter
Frank Slootweg
Honored Contributor

Re: Remoteprinting

> Hi Steve, thank you, i'll have to use your suggestion if i won't find
> another way. But there must be one - if not the use of dedicated
> printservers connected to several application servers wouldn't make
> sense, because each printer that should be used by any user on any
> host must be configured at atleast one app-server AND at the
> printserver. So each printjob is spooled twice and there are at least
> 2 spooler to administrate each printer.

That would indeed be the case, but if you use *network* printers, i.e.
like HP's JetDirect printers, you would configure the printers only on
the app-servers. I.e. if printer X is to be used from 3 app-servers, it
is configured on those 3 apps-servers. If you have 2 printers which each
are to be used from each of 3 app-servers, the total number of printers
in the HP-UX LP (lpsched) system would be 6 (3 times 2). For *remote*
printers it would be 8 (3 times 2 for the app-servers and 2 for the
print-server).
Lothar Krueler
Regular Advisor

Re: Remoteprinting

Thank you all for your support,
it sounds a bit complicated at all, so I think I'll go piping the output to a remsh command.
Best regards
Lothar
Wissen macht zaghaft, Dummheit kann alles!
Stephen Hooper
New Member
Solution

Re: Remoteprinting

You could try rlpr, which does exactly what you have asked for in your message:

http://freshmeat.net/projects/rlpr/?topic_id=154

It compiles very cleanly on HP/UX, and works well for me.
Lothar Krueler
Regular Advisor

Re: Remoteprinting

Hi Stephen,
thanks for your response. I did the download and read the README. I think, if I wan't to use it, I have to install it on every machine i want to print from. This surely is better than administrating redundant printers, but also it's big deal in my environment i have to think about. The basic question seems to be solved - there is no simple statement for printing like "use printername@nodename" without installing additional software or redundant printer(queue)s.

Thanks again for all the responses to this question.

Best regards
Lothar
Wissen macht zaghaft, Dummheit kann alles!