Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

SMcli Overview - The Command Line Interface

The script engine is a utility built into the MDSM software that allows you to issue commands that perform specific
actions for managing a storage array or returning information about the status of a storage array. You can enter
individual commands, or run script files when you need to perform operations more than once (such as installing the
same configuration on several storage arrays). A script file can be loaded and run from the command line interface.
You can also run commands in an interactive mode. Interactive mode enables you to connect to a specific storage
array and rapidly enter a command, determine the effect on the storage array, and then enter a new command.

The engine processes commands that configure and monitor a Storage Array. It processes them one at a time. The
user may access the script engine using the system management command line interface (SMcli) utility at an
operating system prompt.

NOTE:
The SMcli command is installed under the client directory of the selected path during a management station
install of the MDSM software.
You can use the script language commands to define and manage all aspects of a storage array, such as host
topology, virtual disk configuration, and controller configuration. The actual number of commands is large.

NOTE:
If an array password is set, commands that request information from the array can be successfully issued
without the password, but changes to the configuration must be accompanied by the password.
You can use the command line interface to perform the following functions:

• Directly access the script engine and run commands in interactive mode or using a script file.
• Create script command batch files to be run on multiple storage arrays when you need to install the same
configuration on different storage arrays.
• Run script commands on a storage array directly connected to a host, a storage array connected to a host
by an Ethernet, or a combination of both.
• Display configuration information about the storage arrays.
• Add storage arrays to and remove storage arrays from the management domain.
• Perform automatic discovery of all storage arrays attached to the local subnet.
• Add or delete Simple Network Management Protocol (SNMP) trap destinations and email alert notifications.
• Specify the mail server and sender email address or SMTP (Simple Mail Transport Protocol) server for alert
notifications.
• Direct the output to a standard command line display or to a named file.

Access Pathways to the Script Engine


WARNING:
The command line interface is capable of damaging a configuration and causing loss of data if not used
properly. Commands run as soon as you enter them. Some commands can immediately delete configurations
or data. Before using the command line interface, make sure you have backed up all data and saved the current
configuration.
The two pathways to access the script engine are interactive and scripted.

Interactive Access
The scripting engine may be accessed interactively from the command prompt. If you enter SMcli and a storage array
name but do not specify CLI parameters, script commands, or a script file, the command line interface begins running
in interactive mode. Interactive mode enables you to run individual commands without prefixing the commands with
SMcli. You can enter a single command, view the results, and enter the next command without typing the complete
SMcli string. Interactive mode is useful for determining configuration errors and quickly testing configuration changes.
NOTE:
There are several caveats which apply to interactive access. The most important of these are that it gives the
user no acknowledgement as to the completion of an operation, and there is no error checking or error
handling. For this reason the routine use of the interactive method is discouraged and the scripted method
should be used instead.

Scripted Access
The table below lists the general form of some script language commands and provides a definition of each
command.

Examples of Script Language Command Structure and Function

Syntax Description

create object statement-data Creates an object of the specified type

delete object Deletes a previously created object

clear object statement-data Removes a relationship from between objects.

Changes object attributes. All changes


set object statement-data
are completed when the command returns.

Writes information about the object


show object statement-data
to the standard output file.

Command Line Interface Updates


Users of the command line interface should note the following information:

• If configuration of the MD3000 storage array is cleared using the clear storagearray
configuration command, restart all attached hosts prior to reconfiguring the storage array.
• When using the command-line interface to create host ports, ensure that the host type is specified in the
command. If no host is specified, the default host is Windows 2000/Server 20003 Non-Clustered.
• The SMcli -d parameter shows all storage arrays that are currently discovered.

Using the Interface


The following examples show how to enter CLI commands on a command line. The examples show the syntax, form,
and, in some examples, script commands. Examples are shown for both Windows and Linux operating systems. The
usage for the -c parameter varies depending on your operating system. On Windows operating systems, put
quotation marks (" ") around the script command following the -c parameter. On Linux operating systems, put single
quotation marks (' ') around the script command following the -c parameter. In addition, the use of additional double
quotes within the command string requires the use of an escape character. The escape character is the backslash
<\>

. Each time a double quote is used within the command string the escape character must accompany it.
This example shows how to change the name of a storage array. The original name of the storage array is
Payroll_Array. The new name is Finance_Array. The array is being addressed by its name with in-band management,
indicated by the -n. In-band management requires that the management station that issues the command must have
a SAS connection to the array. Otherwise, the command would be issued out-of-band, using the IP address of one of
the RAID Controller Modules.

Windows
SMcli -n "Payroll_Array" -c "set storageArray userLabel=\"Finance_Array\";"

Linux
SMcli -n 'Payroll_Array' -c 'set storageArray userLabel="Finance_Array";'

This example shows how to display all storage arrays in the current configuration. The command in this example
returns the host name of each storage array. If you also want to know the IP address of each storage array in the
configuration, add the -i parameter to the command.

SMcli -d -i

The next example shows the command to reset the service tag on an MD3000 enclosure. The name of the array is
TRNG01A, the password on the array is password, and the new service tag is 6MNL42P. Again, the array name
requires double quotes, so that the escape character < \ > must be used immediately before each double quote.

SMcli -n TRNG01A -p password -c "set enclosure [0] serviceTag=\"6MNL42P"\";

You might also like