How to Open the Script Editor
To open the Script Editor, first select a storage subsystem in the Device Tree View or Device Table. Then, select either the Tools >> Execute Script pull-down menu option, or Execute Script from the right-mouse pop-up menu.
Result: The Script Editor opens. There are two views in the window:
A splitter bar divides the window between Script View and Output View. You can use the splitter bar to resize the views.
Usage Guidelines
Adding Comments to a Script
The Script Editor supports the following comment formats, as described below:
Example: In the following example, the comment "The following command assigns hot spare drives" is included for clarification and is not processed by the Script Editor.
//The following command assigns hot spare drives.
set drives [1,2 1,3] hotspare=true;
Important: You must end a comment beginning with // with an end-of-line character, inserted by pressing the Enter key. If the script engine does not find an end of line character in the script after processing a comment, an error message is displayed and the script execution is terminated. This error commonly occurs when a comment is placed at the end of a script and you have forgotten to press Enter.
Example: In the following example, the comment "The following command assigns hot spare drives" is included for clarification and is not processed by the Script Editor.
/* The following command assigns hot spare drives.*/
set drives [1,2 1,3] hotspare=true;
Important: You must end a comment beginning with /* with */. If the script engine does not find both a beginning and ending comment notation, an error message is displayed and the script execution is terminated.
Using the show statement
Use the show statement to embed comments in your script that will display in the Output View during script execution.
Example: The inclusion of a Show "setting controller mode" statement in your script results in the display of setting controller mode in the Output View when this line is processed during script execution.
Script Editor File Options |
|||||
Task |
How to Perform |
||||
Open a new script |
Select the File >> New Script option. |
||||
Edit an existing script |
|
||||
Save the script in the Script View without prompting for a new filename |
Select the File >> Save Script pull-down menu option. |
||||
Save the script in the Script View with a new filename |
|
||||
Save the script execution results to a local file |
|
Script Editor Edit Options
Use the following Edit menu options for convenient script editing.
Task |
How to Perform |
Cut selected text from the script in the Script View |
Select the Edit >> Cut pull-down menu option. |
Copy selected text from the Script View or Output View to system memory |
Select the Edit >> Copy pull-down menu option. |
Paste information from system memory into the script |
Select the Edit >> Paste pull-down menu option. |
Clear the text in the Script View |
Select the Edit >> Clear Script pull-down menu option. |
Clear the text in the Output View |
Select the Edit >> Clear Output pull-down menu option. |
Select all of the text in the Script View |
Select the Edit >> Select All pull-down menu option. |
Script Editor Tools Options |
|
Task |
How to Perform |
Verify script command syntax |
Select the Tools >> Verify Syntax pull-down menu option. |
Execute the currently loaded script |
Select the Tools >> Verify and Execute option or the Tools >> Execute Only option. (Both options display an error message if a syntax error is encountered, but the Tools >> Verify and Execute option checks the script a line at a time for correct syntax before the script is executed, and it provides syntax error feedback in the Output View.) Result: The Script Editor engine parses the command statements in the script, interprets and converts the statements to the appropriate commands, and sends the commands to the storage subsystem controller. If a syntax error is encountered, the execution stops and an error message is displayed. Fix the error, then use the Verify Syntax or Verify and Execute options to validate the error correction. Important: If an execution error occurs, the script may or may not continue to execute depending on the included On Error script statement.
|
Interpreting the Script Execution Results
During script execution, messages are displayed in the Output View beginning with:
Executing script....
After a successful script execution, you see the message
Script execution complete.
If there is an error during the parse phase, an error is displayed in the output area giving the line and column number and a description of the syntax error.
Example: If you enter the following statement in a script:
set controller[a] mod = passive;
Then the resulting syntax error is displayed in the Output View as shown below:
Encountered "mod" at line 2, column 19
Was expecting one of...
"mode"...
"availability"...
"NVSRAMbyte"...
If there is an error during execution, a message is displayed in the output area stating that the command failed and reporting a description of the error.
Example: If you enter the following statement in a script:
set logical drive [three] userLabel = "OneOne";
In this example, the command could not be sent to the storage subsystem because it was in an Unresponsive state. The resulting error is displayed in the Output View as follows:
Unable to change the logical drive user label using the Set Logical Drive command at line 1
Error - 1 - Could not communicate with the storage subsystem to complete this request.
Important: Certain execution errors, including the inability to communicate with the storage subsystem, always cause script execution to halt. In these cases, execution stops even if you have used the On Error Continue statement.
Use the Back button to return to the previous topic.
Related Links
Recovering from an Unresponsive Controller or Storage Subsystem Condition