Use the Script Editor to create or edit a script file, save a script file to the
To open the Script Editor, perform the following steps:
|
1 |
Select a |
|
2 |
Select either Tools >> Execute Script or Execute Script from the right-mouse pop-up menu. The Script Editor opens. There are two views in the window:
Note: Use the splitter bar that divides the window between Script View and Output View to resize the views. |
Use the following guidelines when building scripts:
Comments can be added to scripts to explain the purpose of the command statements. Use the following guidelines when adding comments to scripts.
Example: The comment "The following command assigns hot spare physical disks." is included for clarification and is not processed by the Script Editor:
//The following command assigns hot spare physical disks.
set physical disks [1,2 1,3] hotspare=true;
Important: You must end a comment beginning with // with an end-of-line character, which is 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 the Enter key was not pressed.
Example: In the following example, the comment "The following command assigns hot spare physical disks." is included for clarification and is not processed by the Script Editor:
/* The following command assigns hot spare physical disks.*/
set physical disks [1,2 1,3] hotspare=true;
Important: Start the comment with /* and end it 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 a script that will display in the Output View during script execution.
Example: The inclusion of a Show "setting RAID controller module mode" statement in your script results in the display of setting RAID controller module mode in the Output View when this line is processed during script execution.
|
Script Editor File Options |
|||||
|
Task |
Action |
||||
|
Open a new script |
Select File >> New Script. 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 file name |
Select File >> Save Script. Note: If you exit the Script Editor without saving a modified script, you are prompted to save the script before exiting. |
||||
|
Save the script in the Script View with a new file name |
|
||||
|
Save the script execution results to a local file |
|
||||
| Script Editor Edit Options | |
|
Task |
Action |
|
Cut selected text from the script in the Script View |
Select Edit >> Cut. |
|
Copy selected text from the Script View or Output View to system memory |
Select Edit >> Copy. |
|
Paste information from system memory into the script |
Select Edit >> Paste. |
|
Clear the text in the Script View |
Select Edit >> Clear Script. |
|
Clear the text in the Output View |
Select Edit >> Clear Output. |
|
Select all of the text in the Script View |
Select Edit >> Select All. |
Script Editor Tools Options |
|
|
Task |
Action |
|
Verify script command syntax |
Select Tools >> Verify Syntax. The Script Editor engine parses the statements in the 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 Tools >> Verify and Execute or Tools >> Execute Only. 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. 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 array RAID controller module. 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 might 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 the following phrase:
Executing script...
After a successful script execution, the following message is displayed:
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 type the following statement in a script:
set RAID controller module[a] mod = active;
Then the resulting syntax error is displayed in the Output View as follows:
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
virtual disk [three] userLabel = "OneOne";The resulting error and command line that caused the error is displayed in the Output View as follows. In this example, the command could not be sent to the storage array because it was in an
state. Unable to change the
virtual disk user label using the SetVirtual Disk command at line 1Error - 1 - Could not communicate with the storage array to complete this request.
The command at line 1 that caused the error is:
set
virtual disk [three] userLabel = "OneOne";
Important: Certain execution errors, including the inability to communicate with the storage array, always cause script execution to halt. When this happens, execution stops even if you have used the On Error Continue statement.
Command Reference Table of Contents
Recovering from an Unresponsive RAID Controller Module or Storage Array Condition