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.
The Script Editor supports the following comment formats:
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: The comment must start with /* and end 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.
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 |
Action |
||||
Open a new script |
Select the File >> New Script option. Result: The Script View is cleared for new script input and the Output View is cleared. |
||||
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. Note: If you exit the Script Editor without saving a modified script, you are prompted to save your script before exiting. |
||||
Save the script in the Script View with a new filename |
|
||||
Save the script execution results to a local file |
|
Use the following Edit menu options for convenient script editing.
Task |
Action |
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 |
Action |
Verify script command syntax |
Select the Tools >> Verify Syntax pull-down menu option. Result: The Script Editor engine parses the statements in your script file one line at a time and verifies that they have the correct syntax. Any syntax errors are displayed in the Output View, reporting the line number of the error and a description of the error. If the Script Editor encounters a syntax error, no further syntax verification is performed on the script. Fix the syntax error and rerun the Verify Syntax command to validate the error correction and check the remainder of the statements in the script. |
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. 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 View 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 = active;
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 View stating that the command failed and reporting a description of the error.
Example: If you enter the following statement in a script:
set
logicalDrive [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
logicalDrive user label using the SetLogical Drive command at line 1Error - 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.
Recovering from an Unresponsive Controller or Storage Subsystem Condition