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:
|
2 |
Enter one or more commands or the name of a script file:
|
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. |
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> |
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:
|
-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.
|
-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:
|
-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. |
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' |
On the storage subsystem with controller names "finance 1" and "finance 2," use the password TestArray to do the following:
|
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" 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 |