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.
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:
|
2 |
Enter one or more commands or the name of a script file:
|
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:
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 -?
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:
|
-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.
|
-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:
|
-s |
Displays the alert settings for the storage subsystems currently configured in the Enterprise Management Window. |
-w |
Specify the Worldwide Name (WWN) of the device on which you want to perform script commands. When used in conjunction with -d, displays the WWN of the storage subsystems contained in the configuration files. |
-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. |
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' |
On the storage subsystem with controller names "finance 1" and "finance 2," use the password TestArray to do the following:
|
On Windows systems: SMcli finance1 finance2 -c "use password"TestArray"; delete On UNIX systems: SMcli finance1 finance2 -c 'use password "TestArray"; delete |
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" 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 |