Using the Command Line Interface

Related Topics

Caution Some command line shells may not support commands longer than 256 characters. Use a different shell or enter the command into the Script Editor. For more information, see Using the Script Editor.

How to Use the Command Line Interface (CLI)

1

Go to the command line shell of your operating system. At the command prompt, enter SMcli, followed by either the controller name, host-agent name, world-wide name (WWN) 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: SMcli hostmachine -n sajason 
  • If you specify the world-wide name of the storage subsystem, use the -w option instead of the -n option. For example: SMcli -w 600a0b800006602d000000003beb684b
  • 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 or WWN, the utility will ensure that a storage subsystem with that name exists at the specified location and can be contacted.

    Note: If the storage subsystem is configured in the Enterprise Management Window (EMW), you can specify the storage subsystem by its user supplied name only using the -n option. For example: SMcli -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: SMcli 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: SMcli 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.

SMcli <hostname or IP address>

[<hostname or IP address>]

[-c '<command>;[<command2>;...]']

[-n <SAName> | -w <WWName>]

[-o <outputfile>] [-p <password>] [-e]

SMcli <hostname or IP address>

[<hostname or IP address>]

[-f <scriptfile>]

[-n <SAName> | -w <WWName>]

[-o <outputfile>] [-p <password>] [-e]

SMcli {-n <SAName> | -w <WWName>}

[-c '<command>;[<command2>;...]']

[-o <outputfile>] [-p <password>] [-e]

SMcli {-n <SAName> | -w <WWName>}

[-f <scriptfile>]

[-o <outputfile>] [-p <password>] [-e]

SMcli -d [-i] [-s] [-W]

SMcli -A [<ip address1> [ip address2]]

SMcli -m <ip address> -F <email address>

SMcli {-a | -x} email:<email address>

[{<ip address1> [ip address2] [-n <SAName>

| -h <hostName>] | -n <SAName>

| -h <hostName>}]

SMcli {-a | -x} trap:<community>,<ip address>

[{<ip address1> [ip address2] [-n <SAName>

| -w <WWName> | -h <hostName>]

| -w <WWName> | -h <hostName>}]

SMcli -?

Command Line Interface Parameters

The command line interface supports the following command line parameters:

Command Line Parameter

Lets you...

<IP address> or <hostname>

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.

-a

Add an SNMP trap destination or e-mail alert destination.

To add an SNMP trap destination:

-a trap:Community,HOST

where

COMMUNITY is the SNMP Community Name set in the NMS configuration file by a Network Administrator. The default is public.

and

HOST is the IP address or the host name of a station running an SNMP service. At a minimum, this will be the Network Management station.

Important: There is no space after the colon (;) or the comma (,).

To add an e-mail alert destination:

-a email:MAILADDRESS

where MAILADDRESS is the fully qualified e-mail address to which the alert message should be sent.

-A

Specify a storage subsystem to add to the management domain.

Specify an IP address (xx.xx.xx.xx) for each controller in the storage subsystem.

Important: If you specify one IP address, the storage subsystem will be partially managed.

If no IP address is specified, an automatic discovery will be performed of storage subsystems attached to the local subnet.

-c

Specify the list of commands to be performed on the specified storage subsystem.

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 (;).
  • Note: Any errors encountered when executing the list of commands will by default cause the execution to stop. Use the on error continue; command first in the list of commands to override this behaviour.

-d

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

The configuration file lists all known storage subsystems that are currently configured in the Enterprise Management Window.

-e

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

-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.

Note: Any errors encountered when executing the list of commands will by default cause the execution to stop. Use the on error continue; command in the script file to override this behaviour.

-F

Specify the e-mail address that will send the alerts.

-i

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

-m

Specify the IP address or host name of the mail/SNMP server that will send the alerts.

-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 stdout.

-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 with the use password command in the script file with the -f parameter.
  • You specify the password with the use password command using the -c parameter.

-s

Displays the alert settings for the storage subsystems currently configured in the Enterprise Management Window.

-w

Specify the storage subsystem, using its Worldwide Name (WWN), on which you want to perform the script commands.

Note: The Worldwide Name is optional when a <hostname> is used or if the -n option is used to identify the storage subsystem with its <storagearrayname>. Use this option INSTEAD of the -n option.

-W

Display the WWNs of all known storage subsystems currently configured in the Enterprise Management Window.

Note: The -W is capitalized (it is lower case when you use the option to specify the WWN) and is followed by the -d option.

-x

Delete an SNMP trap destination or e-mail alert destination.

    To delete an SNMP trap destination:

    -x trap:Community, HOST

    where

    COMMUNITY is the SNMP Community Name

    and

    HOST is the IP address or the host name of a station running an SNMP service.

    To delete an e-mail alert destination:

    -x email:MAILADDRESS

    where MAILADDRESS is the fully qualified e-mail address to which the alert message should no longer be sent.

-?

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 ICTSANT

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

On UNIX systems:SMcli ICTSANT -n 'Payroll Array'
-c 'set storagesubsystem 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: SMcli finance1 finance2 -c "use password"TestArray"; delete logicalDrive[\"Stocks^^^&Bonds\"];create logicalDrive driveCount[3] RAIDLevel=3 capacity=10GB userLabel=\"Finance\";show storagesubsystem healthStatus;"

On UNIX systems: SMcli finance1 finance2 -c 'use password "TestArray"; delete logicalDrive["Stocks&Bonds"];create logicalDrive 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: SMcli -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: SMcli -n Example -f scriptfile.scr -p "My Array"
-o output.txt

On UNIX systems:SMcli -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: SMcli -d -i

Related Topics

Learn about the Command Line Interface

Command Reference