Using the eMBox Command Line Client

One way to access eMBox is to use its Java command line client. The command line client has two modes: interactive and batch. In the interactive mode, you run the eMBox commands one at a time. In the batch mode, you can run a group of commands unattended. The command line client has logging service for both modes.

The command line client is a Java application. To run it, you must have access to the Java Runtime Environment, which is installed with eDirectory. You must also have access behind the firewall to the servers you want to manage. You can perform tasks for multiple servers from one server or workstation.

In this section:


Displaying the Command Line Help

To display the eMBox general command line help before going in to the eMBox Client, do the following:

To display the eMBox interactive command line help while you are in the interactive mode, at the eMBox Client prompt enter a question mark (?). For example,
eMBox Client> ?

The help displays information on the command-line options like the information in eMBox Command Line Client Options .


Running the eMBox Command Line Client in Interactive Mode

Interactive mode lets you run eMBox commands one at a time.

In this section:


Running the eMBox Client on an eDirectory Server

The eMBox Client and the Sun JVM 1.3.1 are installed with eDirectory. To open the eMBox Client in interactive mode on an eDirectory server, do the following:

The edirutil file gives you a shortcut to running the eMBox Client. It points to the Java executable and the default location where the eMBox Client is installed with eDirectory, and for NetWare, it includes the necessary -ns option (which is a Java option on NetWare meaning "new screen"). (You can also enter the information manually, as described in Setting Up the Path and Classpath for eMBox Client .)

You must have access behind the firewall to use the eMBox command line client for the servers you want to manage---so if you are remote, you'll need VPN access.


Running the eMBox Client on a Workstation

To use the eMBox Client on a machine other than an eDirectory server:

You can't use the edirutil command on a workstation as a shortcut to getting in to the eMBox Client in interactive mode as you can on a server. You must either set up the environment once in your path and class path, or enter it manually each time. See Setting Up the Path and Classpath for eMBox Client .


Setting Up the Path and Classpath for eMBox Client

If you are running the eMBox Client on an eDirectory server and have not changed the location of Java or the eMBoxClient.jar file, you can use edirutil as a shortcut to running the eMBox Client. (See Running the eMBox Client on an eDirectory Server .)

But if you have changed the default locations, or you are running the eMBoxClient.jar file on a machine that is not a server, or you wish to enter the classpath manually, you need to set up the path and classpath for the eMBox Client as explained in this section.

You can run the eMBox Client from anywhere on your machine if you do the following:

After doing both of these steps, you can run the client in interactive mode from anywhere on your machine using the following command:

java embox -i

WARNING:  On a NetWare server only, to avoid an abend you must include -ns (a Java option on NetWare for "new screen"). For example,
java -ns embox -i

For information on Java commands, see the Java documentation on the Sun Web site.


Logging In to a Server

To log in to a server, you need to specify the server name or IP address and the port number to connect to a particular server. A username and password are not needed for public logins.

For example, after opening the eMBox Client in interactive mode, enter:

login -s 137.65.123.244 -p 8008 -u admin.mycompany -w mypassword -n

For more information, see Finding Out eDirectory Port Numbers .


Setting Preferred Languages, Timeout, and Log File

The default language is the client system language, so in most cases you won't need to explicitly set a language. Similarly, the default timeout should work in most cases. To set the log file, specify the filename and the mode for opening it (append or overwrite).

See the following table for sample commands.

Command Description
set -L en,de 

Sets the language preference to English and German (in that order).

set -T 100

Sets the timeout to 100 seconds. The timeout setting specifies how long to wait for responses from the server.

set -l mylog.txt -o

Uses mylog.txt as the log file and overwrites when opening it.

Default=append


Listing eMTools and Their Services

After logging in to a server, you can use the list command to display a list of the services available on that server.

The list command displays the following eMTools and their services dynamically:

eMTool Description

backup

Novell eDirectory Backup eMTool

dsmerge

Novell eDirectory Merge eMTool

dsrepair

Novell eDirectory Repair eMTool

dsschema

Novell eDirectory Schema Operations eMTool

service

Novell eDirectory Service Manager eMTool

Use -r to force the refresh of the list. Use -t to list service details. Use -f to list just the command format.

See the following table for sample commands.

Command Description
list

Lists the eMTools available on the server .

list -r

Refreshes the eMTool list.

list -t backup

Lists Backup services with details.

list -t dsrepair

Lists DSRepair services with details.

list -t dsmerge -f 

Lists DSMerge services with command formats only.


Running a Particular Service

You can perform tasks using each of the eMTool services after you have logged in to a server. For example:

Command Description
dsrepair.rld

Repair local database.

backup.getconfig

Get backup configuration information.

For more information, see the eDirectory 8.7 Administration Guide on the Novell documentation web site.


Logging Out From the Current Server

To log out from the current session, use the following command:

logout

If you log in to a different server, you don't need to use this command; you are automatically logged out of the current server.


Exiting the Client

To exit the client, use either of the following commands:

exit

or

quit


Running the eMBox Command Line Client in Batch Mode

There are three ways you can run the eMBox Client in batch mode:

You can use a combination of the system and internal batch files for more flexibility and for organizing and reusing commands that you run often.


Single Tasks

You can perform a single eMBox task in batch mode at the command line, simply by entering the command using the -t option to specify the tool and task, and ommitting the -i option (-i specifies interactive mode). For example,

java embox -s 137.65.123.244 -p 8008 -u admin.mycompany -w mypassword -l mylog.txt -t dsrepair.rld

For multiple tasks on different servers, or for tasks you perform often, a better alternative is to use an internal batch file. For more information, see Internal Batch File below.


Internal Batch File

To run the eMBox Client in batch mode using an eMBox Client internal batch file, you need to create a file which contains a group of eMBox commands you would run in the interactive mode.

An eMBox Client internal batch file lets you run all the commands in the batch file without your attention. You can perform multiple tasks with multiple eMBox tools on the same server without having to log in and log out again for each task. From one server, you can also perform tasks with multiple eMBox tools on multiple servers.

Internal batch files can help you organize and reuse commands that you perform often, so you don't have to enter them manually at the command line each time.

You can go to the command line and run the internal batch file using an eMBox Client command. For example, this command would log in to a server and run the commands listed in the mybatch.mbx file:

java embox -s 137.65.123.244 -p 8008 -u admin.mycompany -w mypassword -l mylog.txt -o -b mybatch.mbx -n

WARNING:  On NetWare only, to avoid an abend you must include -ns (a Java option on NetWare for "new screen"). For example,
java -ns embox -s 137.65.123.244 -p 8008 -u admin.mycompany -w mypassword -l mylog.txt -o -b mybatch.mbx -n

Another option is to put the same kind of command in a system batch file, so that you can schedule it to run on the server unattended. See System Batch File below.

Here is an example of an eMBox internal batch file. It contains examples of the commands you could run and an example of logging in to a different server. This example assumes that you logged in to a server when you opened the eMBox Client. (Each command must be on a separate line. Lines beginning with # are comments.)

# This file is named mybatch.mbx.
# This is an example of commands you could use in 
# an eMBox internal command batch file. 

# Backup commands 
backup.getconfig 
backup.backup -b -f mybackup.bak -l backup.log -t -e -w
 
# DSRepair commands 
dsrepair.rld 

# Log in to a different server
login -s 137.65.123.255 -p 8008 -u admin.mycompany -w mypassword -n

# DSMerge commands 
dsmerge.pr -u admin.mycompany -p admin.mycompany -n mypassword # Schema Operations 
dsschema.rst 
dsschema.dse 
dsschema.rls 
dsschema.gsu 
dsschema.scc 
dsschema.irs -n LocalTree
 
# DSService commands 
service.serviceList 
 
# End of example.


System Batch File

As with other command line tools, you can create system batch files containing eMBox Client commands and run them manually at the command line or schedule them to run on the server unattended.

From one server, you can perform tasks with multiple eMBox tools on multiple servers.

In a system batch file, you can use a combination of eMBox Client single commands and internal batch files for more flexibility and for organizing and reusing commands that you run often. For more information, see Internal Batch File above.


eMBox Command Line Client Options

Option Description

-? or -h

Display help information

-i

Interactively run eMBox commands one at a time.

-s server

Name or IP address of the eMBox server.

Default=127.0.0.1

-p port

Port number of the eMBox server.

Default=80

-u user

User DN. For example, admin.mycompany.

Default=anonymous

-w password

Password associated with the user specified with -u.

-m mode

Login mode.

Default=dclient

-n

Do not try to make a secure SSL connection. Use a nonsecure connection.

If you do not use this option, the eMBox Client will try to establish an SSL connection, and you must have the JSSE files in your class path or it will return an error. See Establishing a Secure Connection with the eMBox Client for more information.

-l log file

Name of the log file.

-o

Overwrite the log file when opening it.

-T timeout

How long (in seconds) to wait for responses from the server.

-L language

List of comma-delimited acceptable languages in order of preference, such as en-US,de_DE. This option defaults to the client system language.

-t [tool.]task options

Perform a single service with this connection. The string following -t should be a valid eMBox command.

-b eMBox batch file

Perform a group of services as specified in the batch file. The eMBox commands in the batch file should be put on separate lines. Lines preceded by # are comments.


Establishing a Secure Connection with the eMBox Client

If you use a nonsecure connection, all the information you enter, such as user names and passwords, is sent over the wire in clear text.

If you instead want to establish a secure connection using SSL, do the following:


Finding Out eDirectory Port Numbers

When logging in to a server in the eMBox Client, you must specify a port number.

If you specified a port number when you installed eDirectory, use that number.

The default ports are as follows:

Below are some additional tips for finding out the port that is assigned to eDirectory:


On Windows

  1. Click Start > Settings > Control Panel.

  2. Double-click the Novell eDirectory Services icon, then click the Transport tab.

  3. Look up the secure or nonsecure port.

    Click the plus sign next to Bound Transports to see the port number.


On NetWare

The Network Address property of a Server object will show you the ports.

You can look up the Network Address property of a server object in the following tools:

Look for the network addresses that begin with http: or https: and have "/portal" at the end. These are the nonsecure and secure ports used for eMBox tools.

Here's how to tell what the port number is:


On UNIX

You can use this command to see a list of ports:
ndsconfig get | grep http

Look for the lines that say http.server.interface and then a port number.

You can also look up the port number in iManager or ConsoleOne using the same method described for NetWare. See On NetWare for more information.