Using the Command Line Interface

Related Topics

How to Use the Command Line Interface (SM7cli)

1

Go to the command line shell of your operating system. At the command prompt, enter SM7cli, followed by either the controller name, host-agent name, or user-supplied name of the specific storage subsystems. The name you enter depends on your storage subsystem management method:

  • Directly managed. Enter: <hostname or IP address> of the controller(s)
  • Host-agent managed. Enter: <hostname or IP address> of the host.

    Important: You must use the -n option if more than one host-agent managed storage subsystem is connected to the host. For example: SM7cli hostmachine -n sajason 

  • If you specify a host name, or the IP address, the command line utility will verify the existence of a storage subsystem.
  • If you specify the user-supplied storage subsystem name, the utility will ensure that a storage subsystem with that name exists at the specified location.

    Note: If the storage subsystem is configured in the Enterprise Management Window, you can specify the storage subsystem by its user supplied name only using the -n option. For example: SM7cli -n "Storage Subsystem London". The name must be unique to the EMW.

2

Enter one or more commands or the name of a script file:

  • One or more commands: Enter -c "<command>;[<command2>;...]"
  • Script file: Enter -f <scriptfile>

Result: SM7cli first verifies the existence and locations of the specified storage subsystems and if applicable, the script file. Next, it verifies the script command syntax and then executes the commands.

3

Specify the output file [-o <outputfile>], password [-p <password>, or[-e] to execute the script only. These arguments are optional.

Important: SM7cli has the following usage and formatting requirements:

CLI Usage Examples

Following are examples of CLI command and syntax usage. For more information, see Command Line Interface Parameters or CLI Examples.

SM7cli <hostname or IP address>
[<hostname or IP address>]
-c <command>;[<command2>;...] [-n <name>]
[-o <outputfile>] [-p <password>] [-e]

SM7cli <hostname or IP address>
[<hostname or IP address>]
-f <scriptfile> [-n <name>] [-o <outputfile>]
[-p <password>] [-e]

SM7cli -n <name>
-c <command>;[<command2>;...]
[-o <outputfile>] [-p <password>] [-e]

SM7cli -n <name> -f <scriptfile> [-o <outputfile>]
[-p <password>] [-e]

SM7cli -d [-i]

SM7cli -?

Command Line Interface Parameters

The command line interface supports the following command line parameters:

Command Line Parameter

Lets you...

<IP address>
or <hostnam
e>

Specify an IP address (xx.xx.xx.xx) or hostname (of host-agent or controller) of a storage subsystem managed through the host-agent or directly- managed method.

-c

Specify the list of commands to be performed on the specified storage subsystem. Each command must be terminated by a <;>.

Important: Note the following usage requirements:

  • You cannot place multiple -c parameters on the same command line. However, you can include multiple commands after the -c parameter.
  • Each command must be terminated with a semicolon (;
  • Windows: The entire command string must be enclosed in double quotes ("). Each command must be terminated with a semicolon (;).
  • Unix: The entire command string must be enclosed in single quotes ('). Each command must be terminated with a semicolon (;).

-f

Specify the name of a file containing script engine commands to be performed on the specified storage subsystem. Use the -f parameter in place of the -c parameter.

-n

Specify the storage subsystem name on which you want to perform the script commands.

  • This name is optional when a <hostname or IP address> is used. However, if you are managing the storage subsystem using the host-agent management method, you must use the -n option if more than one storage subsystem is connected to the host at the specified address.
  • This name is required when the <hostname or IP address> is not used. However, the storage subsystem name must be configured for use in the Enterprise Management Window and must not be a duplicate of any other configured storage subsystem name.

-o

Specify a file name for all output text from the script engine. If this parameter is not used, the output will go to the screen.

-p

Specify the password for the storage subsystem on which you want to perform a command script. A password is not necessary if:

  • A password has not been set on the storage subsystem.
  • The password is specified in the script file with the -f parameter or with the -c script command.
  • You specify the password using the -p parameter.

-e

Execute the script only, without performing a syntax check first.

-d

Display the contents of the configuration file in the following format: <storagearrayname> <hostname> <hostname>.

-i

When used with the -d parameter, display the contents of the configuration file in the following format: <Storage Array Name> <IP address> <IP address>.

-?

Display usage information.

CLI Examples

Following are examples of how you can use the CLI to access and execute script engine commands. Note that the usage for the -c command varies depending on your operating system. On UNIX systems, the -c command line string must be enclosed in single quotation marks ('). On Windows NT systems, the -c command must be enclosed in double quotation marks (").

Task

Enter:

Rename "Payroll Array" to "Finance Array" using the hostname ICTSAN

On Windows systems: SM7cli ICTSANT -n "Payroll Array" -c "set storagearray userlabel=\"Finance Array\";"

On UNIX systems:SM7cli ICTSANT -n 'Payroll Array'
-c 'set storagearray userlabel="Finance Array";'

On the storage subsystem with controller names "finance 1" and "finance 2," use the password TestArray to do the following:

  • Delete the logical drive named "Stocks & Bonds"
  • Create a new logical drive named "Finance"
  • Show the health status of the storage subsystem, which is managed via the direct management method.

On Windows systems: SM7cli finance1 finance2 -c "use password"TestArray"; delete logical drive[\"Stocks^^^&Bonds\"];create logical drive driveCount[3] RAIDLevel=3 capacity=10GB userLabel=\"Finance\";show storageSubsystem healthStatus;"

On UNIX systems: SM7cli finance1 finance2 -c 'use password "TestArray"; delete logical drive["Stocks&Bonds"];create logical drive driveCount[3] RAIDLevel=3 capacity=10GB userLabel="Finance";show storageSubsystem healthStatus;'

Execute the commands found in the script file named scriptfile.scr in the storage subsystem named "Example" without performing a syntax check.

On Windows and UNIX systems: SM7cli -n Example -f scriptfile.scr -e

Execute the commands found in the script file named scriptfile.scr on the storage subsystem named "Example," using "My Array" as the password and directing all output to output.txt

On NT systems: SM7cli -n Example -f scriptfile.scr -p "My Array"
-o output.txt

On UNIX systems:SM7cli -n Example -f scriptfile.scr -p 'My Array' -o output.txt

Display all storage subsystems currently configured in the Enterprise Management Window (configuration file), using <IP address> format instead of <hostname> format.

On Windows and UNIX systems: SM7cli -d -i

Related Topics

Learn about the Command Line Interface

Command Reference