Open Source

Connecting Linux workstations to your NetWare print queues

You know that you can connect your Linux workstations to volumes on your NetWare servers. But what about your NetWare-based printers? John Sheesley shows you how to connect your Linux workstations to those as well.

In the Daily Drill Down “Connecting Linux workstations to your NetWare server,” I showed you how to access NetWare volumes from your Linux workstations. Of course, there are more resources on your NetWare servers than just shared hard drives. Chances are, you also have network printers controlled by your NetWare servers. How do you print to NetWare printers from your Linux workstations? In this Daily Feature, I’ll show you how.

Author’s note
If you’re familiar with Linux, you know there are many different distributions and versions available. I’ll be using Red Hat 7.1 in this Daily Drill Down. However, if you’re using a different version of Red Hat or a separate Linux distribution, don’t panic. What I’m covering will work on most distributions.

Making the connection
As I pointed out in the Daily Drill Down mentioned above, before you can connect to resources on your NetWare server, you’ll need to configure IPX on your Linux workstation. For detailed information about how to do so, see my Daily Drill Down “Connecting Linux workstations to your NetWare server,” but for now, you can make sure you have the commands you’ll need to use. To check to see if ipxutils and ncpfs are installed on your Linux workstation, open a terminal window, type rpm –q ipxutils, and press [Enter]. If ipxutils is present, you’ll see
ipxutils-2.2.0.18-3

Likewise to check for ncpfs, open a terminal window, type rpm –q ncpfs, and press [Enter]. If ncpfs (the file system needed to access NetWare resources) is present, the workstation will display something like:
ncpfs-2.2.0.18-3

The actual version may be different, depending on the version of ncpfs that came with your distribution.

After you’ve confirmed that you have the proper utilities installed, you can check to see if you have a connection to your NetWare servers. To do so, type slist at the Linux workstation’s command prompt. You’ll then see a list of your NetWare servers.

From there, you have two choices in order to print files to your NetWare print queues: You can either configure a permanent connection to a print queue using RedHat’s PrintConf utility or use the nprint command from the command prompt.

Configuring a queue using PrintConf
PrintConf is Red Hat’s printer configuration utility. To start it, open a command prompt on your Linux workstation, type su –, and press [Enter]. You’ll then need to type in the root password.

When the root prompt appears, type printtool and press [Enter]. When you do, you’ll see the printconf-gui window appear, as shown in Figure A. Here, you can view, add, or delete print queues for your Linux workstation.

Figure A
You can connect to your NetWare printers using PrintConf.


Click New to add a new print queue for your workstation. You’ll then see the Edit Queue window appear. In the left pane, you’ll notice that the Names And Aliases field is highlighted. In the right pane, provide a name for the queue you’re adding in the Queue Name field. To make things easier to remember, you may want to name the queue the same as the NetWare queue to which you’ll be printing.

Next, click Queue Type in the left pane. You’ll notice new information appearing in the right pane. There, you can enter the information necessary to connect to the NetWare queues. First, click the Queue Type drop-down list and select Novell Printer (NCP Queue).

When you do, you’ll notice four new fields appear under the Queue Type drop-down list. The information you’ll enter in the following fields is fairly self-explanatory:
  • Server is where you enter the NetWare server that’s servicing the print queue that you want to use.
  • User indicates the NetWare user ID needed to connect to the NetWare server.
  • Queue requires you to enter the name of the NetWare print queue that will be servicing the print request.
  • Password is asking for the password for the user ID that’s listed in the User field.

Finally, click Printer Driver in the left pane. You must then select the appropriate printer driver for the printer connected to the NetWare print queue.

When you’re finished, click OK. You’ll then see the queue information appear in the printconf-gui window. If you have more than one print queue listed, you can set your NetWare queue to be the default by selecting it from the list and clicking Default.

After you’ve configured the queue, you’re ready to go. Just click Apply to save the changes you’ve made and close printconf-gui. Open a Linux application, and you’re finished.

Using the nprint command
One of the things that command-line bigots love about Linux is that whatever you can do from a GUI, you can also do at the command prompt. This is also true of printing to NetWare queues. Linux includes the nprint command to allow you to print files directly to your NetWare queue from text files.

It can be a bit annoying to use with applications, though. It doesn’t permanently map the queue. To use it with most applications, you’ll need to print to a file and then issue the nprint command. It’s possible to automate the nprint command to print directly to the lpd printer daemon used by Linux, but that requires some scripting that’s beyond the scope of this Daily Drill Down.

The nprint command itself works a lot like the ncpmount command that I described in a previous Daily Drill Down. The basic syntax for nprint is:
nprint file –S server –U user –P password –q queue

where file is the name of the file you want to print, server is the name of the server that services the printer, user is the user id that has rights to the server, password is the user password to access the server, and queue is the name of the NetWare print queue to use. Other switches you can use with the nprint command include:
  • -h—This switch displays help for the command.
  • -S server—Use this to specify the name of the NetWare server that services the queue.
  • -U user—To specify the user id that connects to the NetWare server, use this switch.
  • -P password—This switch specifies the password for the user id connecting to the NetWare server. If you don’t use this switch, nprint will prompt you for a password (if your server requires one).
  • -n—This switch tells nprint that you don’t need a password to access your NetWare server.
  • -C—This switch prevents nprint from converting passwords to uppercase before submitting them to the server for authentication.
  • -q queuename—This allows you to specify the name of the queue to which nprint will print.
  • -d description—If you use this switch and replace description with a description of the print job, the description will appear at the top of the banner page and in Pconsole.
  • -p pathname—This string causes the pathname of the file you’re printing to appear on the banner page.
  • -b banner—This switch displays the banner value in the printed banner of your print out. The value of banner can’t exceed 12 characters.
  • -f filename—With this switch, you are able to enter a custom filename to appear on the banner page. You can enter up to 12 characters for a filename. If you don’t supply this switch, nprint uses the name of the file by default.
  • -l lines—By default, nprint prints 66 lines on each page. You can change this value by specifying this switch with a different value for lines.
  • -r rows—This switch controls the number of rows to print on each page. The default number of rows is 80.
  • -c copies—By using this switch, you can specify the number of copies for nprint to produce.
  • -t tab—This switch tells nprint how many spaces to substitute when printing a tab character. By default, nprint uses eight spaces for each tab.
  • -N—This switch tells the printer not to use form feeds.
  • -F form number—If you use custom forms with your print jobs, you can specify the form number with this switch.

Finding a NetWare print queue
As you could see with both the nprint command and the PrintConf configuration, to print to a NetWare print queue, you must first know the name of the queue. But what do you do if you don’t know the name of the queue? All you have to do is use the pqlist command.

The basic syntax for the pqlist command is similar to the nprint command. Just drop to a console prompt, type pqlist –S server –U user –P password and press [Enter]. You’ll then see a list of all of the available print queues on the NetWare server you specify with the –S switch.

Conclusion
Linux can play nicely with your NetWare servers once you know how to make them talk to each other. Linux workstations can use both NetWare volumes and NetWare printers. With a few simple commands, you can easily configure your penguin-based PCs to print to your NetWare print queues.
0 comments

Editor's Picks