How to setup network printer under Solaris via command line?

How to setup network printer under Solaris via command line?

Post by Paul Dowset » Fri, 02 Feb 2001 09:48:28



We have a Sun Sparc machine running Solaris 7, and a Hewlett Packard Colour
Laserjet 8550DN (which is a Postscript printer).  Both are connected
directly to the network, and can communicate correctly via IP.
I have already set up a queue for the printer which works, using
Admintool/RemotePrinter options.  This works ok, but there is no interface
created (therefore no way of customising the filter).

Therefore, I need to know the correct command-line syntax for the following:

lpadmin -p lp3 -i /usr/lib/lp/modem/netstandard -v /dev/null -o
dest=hp8550dn -Ipostscript

Note: there is an entry in the hosts file which maps the name "hp8550dn" to
an ip address.

This does add a queue, and an interface filter, but when I print the hosts
file with this command....

unix2dos /etc/hosts | lp -dlp3

....all I get is a banner page, with no "hosts" file printout.

Can anyone tell me why, and what is incorrect about my lpadmin command?
Should I be using lpfilter at some point? What is it for, and how should I
use it? (don't understand the man pages, I'm afraid)

Note: One thing that I have noticed, is that when the interface is created
in /etc/lp/interfaces, a script appears in a sub-directory called model.orig
with the same queue name.  When viewed, it seems to have something to do
with jetadmin (even though jetadmin is not installed).  Is this normal with
the default install of solaris?  I think jetadmin was installed once, but
then uninstalled.

I REALLY appreciate your help!
Paul

 
 
 

How to setup network printer under Solaris via command line?

Post by Martin Pau » Fri, 02 Feb 2001 17:54:24



Quote:> Note: One thing that I have noticed, is that when the interface is created
> in /etc/lp/interfaces, a script appears in a sub-directory called model.orig
> with the same queue name.  When viewed, it seems to have something to do
> with jetadmin (even though jetadmin is not installed).  Is this normal with
> the default install of solaris?  I think jetadmin was installed once, but
> then uninstalled.

This leads to the obvious question - why don't you install jetadmin ?
It'll do all the work for you, and has filter scripts which support
the printer's features well.

mp.
--
                         Martin Paul | Systems Administrator

Liechtensteinstrasse 22, A-1090 Wien | Tel: 01 4277 38803
        http://www.par.univie.ac.at/ | Fax: 01 4277 9388

 
 
 

How to setup network printer under Solaris via command line?

Post by Heimo Lindgre » Fri, 02 Feb 2001 22:40:57


Paul Dowsett wrote:

> We have a Sun Sparc machine running Solaris 7, and a Hewlett Packard Colour
> Laserjet 8550DN (which is a Postscript printer).  Both are connected
> directly to the network, and can communicate correctly via IP.
> I have already set up a queue for the printer which works, using
> Admintool/RemotePrinter options.  This works ok, but there is no interface
> created (therefore no way of customising the filter).

> Therefore, I need to know the correct command-line syntax for the following:

> lpadmin -p lp3 -i /usr/lib/lp/modem/netstandard -v /dev/null -o
> dest=hp8550dn -Ipostscript

> Note: there is an entry in the hosts file which maps the name "hp8550dn" to
> an ip address.

> This does add a queue, and an interface filter, but when I print the hosts
> file with this command....

> unix2dos /etc/hosts | lp -dlp3

> ....all I get is a banner page, with no "hosts" file printout.

> Can anyone tell me why, and what is incorrect about my lpadmin command?
> Should I be using lpfilter at some point? What is it for, and how should I
> use it? (don't understand the man pages, I'm afraid)

> Note: One thing that I have noticed, is that when the interface is created
> in /etc/lp/interfaces, a script appears in a sub-directory called model.orig
> with the same queue name.  When viewed, it seems to have something to do
> with jetadmin (even though jetadmin is not installed).  Is this normal with
> the default install of solaris?  I think jetadmin was installed once, but
> then uninstalled.

> I REALLY appreciate your help!
> Paul

I have made the following guide for our support:

This is how I install any (matrix, laser,..) printer using  HP JetDirect
box for
one to three printers, or HP internal MIO board.

For Sparc's the latest JetDirect can be downloaded from www.hp.com,
for x86 I found an older jetdirect at
www.riddleware.com/pub/Solaris/x86/jetadmin.0.9.sun_x86.tar.Z,
and this seems run OK with Solaris V8 10/00 x86

Ths is what I do:

1) Define an IP-address for your JetDirect box, add that to
        /etc/hosts, eq. 192.168.1.100   PR4
        For multiport box add all printers to the same line
        /etc/hosts, eq. 192.168.1.100   PR4 PR5 PR6

2) Find out the MAC-address of Your JetDirect box,
        see a label under the box, like AD:0060B0FA50AB,
        or make a test print.

3) To set the IP for this box You can use BOOTBD,or RARPD, I use RARPD.
        Edit /etc/ethers, add line 00:60:B0:FA:50:AB   PR4

4) Power on Jetdirectbox or printer. Start (if not running) in.rarpd
-ad   d=debugmode,
        and see how Your box is assigned the IP, may take a while.
        See: man in.rarpd for details.
        Sometimes the internal MIO's need to be given the IP by hand, via
printer's
        controlpanel.

5) Test with ping PR4, or telnet PR4 to see/set configuration.

6) Download and install HP Jetadmin software package.
        will install in /opt/hpnp

7) As root start  /opt/opt/hpnp/admin/jetadmin

# selection shown with  --------->

           *************************************************
           *                  MAIN MENU                    *
           *  HP JetAdmin Utility for UNIX (Rev. xxxxxxx)  *
           *************************************************

-----> 1) Configuration (super-user only):
            - configure printer, add printer to spooler

       2) Diagnostics:
            - diagnose printing problems

       3) Administration (super-user only):
            - manage HP printer, JetDirect
       4) Administration (super-user only):
            - manage JetAdmin

       5) Printer Status:
            - show printer status, location, and contact

                   ?) Help         q) Quit

Please enter a selection (q - quit): 1

          ***************************************
          *            CONFIGURATION            *
          *     HP JetAdmin Utility for Unix    *
          ***************************************

        Printer Network Interface:
            1) Create printer configuration in BOOTP/TFTP database
            2) Remove printer configuration from BOOTP/TFTP

        Spooler:
---->       3) Add printer to local spooler
            4) Delete printer from local spooler
            5) Modify existing spooler queue(s)

               ?) Help            q) Quit

Please enter selection: 3

Enter the network printer name or IP address (q - quit): PR4

    Following is a list of suggested parameter values for this queue.
You
    may change any settings by selecting the corresponding non-zero
numbers.
    The values will be used to configure this queue when '0' is
selected.
    To abort the operation, press 'q'.

Configurable Parameters:            Current Settings
-----------------------             ----------------
   1) Lp destination (queue) name     [PR4_1]           <---- Change
   2) Status log                      [(No log)]        <---- Change?
   3) Queue class                     [(not assigned)]
   4) JobMonitor                      [OFF]
   5) Default queue                   [NO]      <---- Change?
   6) Additional printer configuration...       <---- Change?

Select an item for change, or '0' to configure (q-quit): 6

    Following is a list of suggested parameter values for this printer.
    To abort this operation, press 'q'.

   Configurable Parameters:               Current Settings
   ------------------------               ----------------

   1) Model Script:                        [net_ljx000] <---- Change?
   2) Default Printing Language            [AUTO]
   3) Job Recovery                         [ON]         <---- Change?
   4) True End-of-Job                      [ON]         <---- Change?
   5) Banner Page                          [ON]         <---- Change?
   6) PostScript Level                     [Level 2]

Select an item for change, or q when done: q

    Following is a list of suggested parameter values for this queue.
You
    may change any settings by selecting the corresponding non-zero
numbers.
    The values will be used to configure this queue when '0' is
selected.
    To abort the operation, press 'q'.

Configurable Parameters:            Current Settings
-----------------------             ----------------
   1) Lp destination (queue) name     [PR4]
   2) Status log                      [(log)]
   3) Queue class                     [(not assigned)]
   4) JobMonitor                      [OFF]
   5) Default queue                   [NO]
   6) Additional printer configuration...

Select an item for change, or '0' to configure (q-quit): 0   <---

Ready to configure PR4.
OK to continue? (y/n/q, default=y) y

......
Finished adding "PR4" to the spooler.
Press the return key to continue ...

And so on.

Jetdirect will create two scriptfiles:

/etc/lp/interface/PR4            which is the one talking with Your box.
/etc/lp/interface/model.orig/PR4 which is the real interfacescript,
                                 and can be customized as needed.

An existing printer interface script may be copied over to model.orig/*

In the file /etc/lp/interface/PR4 there are lines like:
PERIPH=PR4              the address of Your box
xPORT=                  empty if using 1-port box
xPORT=" -p 9100"        first port of 3-port box
xPORT=" -p 9101"        second  port of 3-port box
xPORT=" -p 9102"        third port of 3-port box

Jetadmin may not be clever enough to ask You on which port
of the box the printer is connected, this way You can tell it.

Test print and print out options list: lp -dPR4 -ooptions  filename
You'll get a list of known options for this interface, like
charset, lpi, cpi, font, textlen, postscipt, landscape etc. Most of them
can be preset by editing the model.orig/PR4 script.

Printing can also be tested by piping a file through telnet, like:
cat file | telnet PR4 9100, remember ^M at the end of line

regards

Heimo Lindgren

Finland

 
 
 

How to setup network printer under Solaris via command line?

Post by Paul Dowset » Sat, 03 Feb 2001 02:15:58


Heimo

That seems to be the perfect explaination on how to use Jetadmin.  I'm
grateful, because I could never get it to work any

better under Jetadmin, and always wondered, "what's the point??!"  It's a
shame HP (and Sun too, for that matter) can't

provide clear documentation/tutorials like yours. They should give you a
job!!!  ;-)

 
 
 

How to setup network printer under Solaris via command line?

Post by Paul Dowset » Sat, 03 Feb 2001 02:19:34


1) Regarding my original question, which part of my original command (
lpadmin -p lp3 -i /usr/lib/lp/modem/netstandard -v

/dev/null -o dest=hp8550dn -Ipostscript ) is causing it to not work
correctly?

2) Is it because of the "netstandard" script/interface being used, because
the printer doesn't understand it's output?

3) If so, what kind of printers is the netstandard interface meant for?

4) What is purpose of the -v /dev/null option?

5) What is the correct command-line syntax of lpadmin to add a remote
printer (as can be done with Admintool)?  Would it be

"lpadmin -p lp3 -o dest=hp8550dn" or is the -v /dev/null still required?

6) What is the difference between, and purpose of, the filter definitions
and the interfaces (ie.netstandard and standard)?

Sorry there are so many questions, but I feel that I will understand the
Unix printing system concepts quite well once I have

filled in these "holes"!

Many thanks
Paul

 
 
 

How to setup network printer under Solaris via command line?

Post by Greg Andre » Sat, 03 Feb 2001 15:24:56



>We have a Sun Sparc machine running Solaris 7, and a Hewlett Packard Colour
>Laserjet 8550DN (which is a Postscript printer).  Both are connected
>directly to the network, and can communicate correctly via IP.
>I have already set up a queue for the printer which works, using
>Admintool/RemotePrinter options.  This works ok, but there is no interface
>created (therefore no way of customising the filter).

>Therefore, I need to know the correct command-line syntax for the following:

>lpadmin -p lp3 -i /usr/lib/lp/modem/netstandard -v /dev/null -o
>dest=hp8550dn -Ipostscript

>Note: there is an entry in the hosts file which maps the name "hp8550dn" to
>an ip address.

>This does add a queue, and an interface filter, but when I print the hosts
>file with this command....

>unix2dos /etc/hosts | lp -dlp3

>....all I get is a banner page, with no "hosts" file printout.

>Can anyone tell me why, and what is incorrect about my lpadmin command?

It's missing the printer type definition.  Delete the queue and
re-add it like this:

  lpadmin  -p lp3  -v /dev/null  -m netstandard
  lpadmin  -p lp3  -o protocol=bsd  -o dest=hp8550dn
  lpadmin  -p lp3  -T PS  -I postscript
  enable  lp3
  accept  lp3

Quote:

>Should I be using lpfilter at some point? What is it for, and how should I
>use it? (don't understand the man pages, I'm afraid)

You can use it to make sure the filter for converting plain text to
Postscript is installed:

  cd /etc/lp/fd
  lpfilter -f postprint -F postprint.fd

Adding the other filters with .fd files in that directory wouldn't
hurt, also.

Quote:

>Note: One thing that I have noticed, is that when the interface is created
>in /etc/lp/interfaces, a script appears in a sub-directory called model.orig
>with the same queue name.  When viewed, it seems to have something to do
>with jetadmin (even though jetadmin is not installed).  Is this normal with
>the default install of solaris?  I think jetadmin was installed once, but
>then uninstalled.

The stock Solaris lpadmin command does not add any files to a model.orig
directory.  It copies the interface script from the model directory to
the interfaces directory.  Perhaps you've been looking at old interface
scripts installed by Jetadmin and being confused by them.  Or perhaps
someone put a wrapper around the original lpadmin command that copies
backup versions of the interface scripts into a model.orig directory.

By the way, the files in /etc/lp/interfaces are insterface *scripts*.
They are not filters.  (Jetadmin was very strange and would define an
interface script as a filter, so perhaps that was confusing you)

  -Greg
--

I have a map of the United States that's actual size
                 -- Steven Wright

 
 
 

How to setup network printer under Solaris via command line?

Post by Paul Dowset » Sun, 04 Feb 2001 08:39:36


I added a new print queue using the Jetdirect installer.  However, I now
have 2 problems/questions:

1) I am unable to "modify a print spooler" to change options like "job
recovery" etc using the Jetdirect Installer after the queue has been
successfully added.

2) When I try to delete a print job at the printer using the cancel button,
it cancels the job but then prints another copy.  (even though the job
recovery option is set to off)

Has anyone any ideas, please?

.

 
 
 

How to setup network printer under Solaris via command line?

Post by Greg Andre » Sun, 04 Feb 2001 11:20:59



>I added a new print queue using the Jetdirect installer.  However, I now
>have 2 problems/questions:

>1) I am unable to "modify a print spooler" to change options like "job
>recovery" etc using the Jetdirect Installer after the queue has been
>successfully added.

Perhaps Jetdirect requires you to delete the queue and re-add it with
the job recovery feature selected?  What does the README file and/or
the man page for hppi say about that feature?

Quote:

>2) When I try to delete a print job at the printer using the cancel button,
>it cancels the job but then prints another copy.  (even though the job
>recovery option is set to off)

Use the /usr/bin/cancel command to cancel the print job from the
Solaris print queue, then use the printer's cancel button to erase
the print job from the printer's memory.

  -Greg
--

I have a map of the United States that's actual size
                 -- Steven Wright

 
 
 

How to setup network printer under Solaris via command line?

Post by martha starke » Fri, 02 Feb 2001 22:43:00


You really should be using jetadmin/jetdirect for this:

http://www.hp.com/cposupport/networking/software/SOLe118.PKG.html

Perhaps the printer is not autoselecting postscript.  I also notice that
your -I option is fine, but you did not use a -T option.  Usually with a
postscript printer, we say -T PS -I postscript.  You could also disable
the queue and check out the data file (/var/spool/lp/tmp/<hostname> and
make sure the adobe postscript characters are at the top of the file (to
make sure the postprint filter is doing it's thing).  Or send one of the
ps files found in /usr/openwin/share/images/PostScript and send it posix
style to the printer like this: lp -d <hostname of printer>:<RAW>
that will bypass the lp filter stuff and send a ps filter directly to
the printer.  If that doesn't print then something is going on with the
printer.

Or install jetdirect.  If you are only used lpadmin and Solaris, then
the model.orig directory should not be in the picture. perhaps the
software is installed already; check the /opt directory for hpnp or
hpnpl.

 
 
 

1. How To Setup A Networked Printer Via IP Address

Hello there,

I am new to Solaris, and I have a question on how to setup a networked
printer via IP address.  We are running Sun Solaris 2.5.1.  I would
like to setup a HP Laser4 postscript printer with a HP Jet direct card
on the system.  I was told to use remote and print through another
UNIX server.  However, I do not want to setup the printer where it has
to depend upon another server's existence.  On Windows NT platform, I
can use LPR to direct print job to the IP address of this printer.  Is
it possible to do that in Solaris?  If so, how do I add this printer
to this Solaris system?

Thanks in advance for your help!

Regards,
Yee

2. very strange mouse problems

3. Star Office printer setup via Samba smbprint to remote printer

4. Saving My Modem's Auto Answer Setting Upon Reboot Box

5. Solaris 2.3 Network Printer Setup

6. Help: Driver for SMC EtherEZ card?

7. Redirecting a queue to another port via command line

8. Screen config under Solaris 8

9. Installing Mcafee Dat files on linux red hat 6.2 via command line

10. Sending MIME attachments via command line

11. Providing additional init cmds via command line

12. Determining Processor Speed via the command line?

13. Talking to the modem via command line?!?!?!