Sun Management Center 3.5 System Reliability Manager User's Guide

Script Launcher Module

The Script Launcher module enables you to delegate management functions to agents. Management functions are management scripts written in a management scripting language. The Script Launcher module is a multi-instance module. All instances of the Script Launcher module access the same Script Repository module for language and script information.

The module includes the following two tables:

The Script Launcher module enables you to manipulate scripts as follows:

The security for Script Launcher module is implemented as follows:

To Access the Script Launcher Module
  1. Load the module.

    See the Sun Management Center 3.5 User's Guide for more information. The Script Repository module is available under Local Applications in the Browser window.

  2. Double-click Local Applications in the Browser window.

  3. Double-click Script Launcher.

    The Script Launcher displays the Launch Table and the Result Table.

    Module browser with Script Launcher and tables. The context describes the graphic.

Launch Table

The Launch Table controls the execution of all scripts. This table describes scripts that are ready to be launched along with descriptions of their parameters.

An entry in the Launch Table attaches an argument to a script. The entry also defines the owner, who is used to associate permissions to execute the script.

Several instances of a script may be created through one single entry on this table. Also, several entries on this table may point to a same script on the Script Table. You can execute several identical scripts with different arguments and different permissions. Scripts can only be run with the launch owner's permissions.

The Launch Table has the attributes listed in the following table.

Table 5–2 Launch Table Attributes

Attribute 

Description 

Launch Owner 

The manager who owns this entry. 

Launch Name 

The name of the entry. Names should be unique for each row in the launch table.  

Script Owner  

In combination with the script name, identifies the script.  

Script Name  

In combination with the script owner, identifies the script. 

Arguments  

Arguments to be supplied to the script. 

Launch Start  

Initiates execution of a script. Before a script is launched, the following conditions must be satisfied:

  1. The Operation Status for the entry should be in enabled state.

  2. There should be an entry in Script Table with the same values in the Script Owner and Script Name fields.

  3. The Script Operation Status field in the script table should be in enabled state.

  4. The Launch Owner has necessary security permissions to launch the script.

Launch Control  

This object is used to request a state change for all running scripts in the Run Table started from the Launch Table.  

Admin Status  

The desired status of this launch table entry, which can be either enabled or disabled.  

Operation Status  

The actual status of this launch table entry, which can be either enabled or disabled.  

Max Running  

The maximum number of concurrently running scripts that may be invoked from this entry. The default value is 3. This field can be modified by directly writing into the field.  

Max Completed  

The default value is 3. The maximum number of finished scripts invoked from this entry in the Launch Table that are allowed to be retained in the Result Table.  

Life Time  

The default maximum amount of time that a script launched from this entry may run. The default value is 86,400 seconds (1 day).  

Expire Time 

The default maximum amount of time that information about a script launched from this entry is kept in the Result Table after the script has completed execution. 

To Add a New Entry to the Launch Table
  1. Access the Launch Table as described in To Access the Script Launcher Module.

  2. Press mouse button 3 on the Launch Table header.

    A pop-up menu is displayed.

    Module browser with Launch Table and menu. The context describes the graphic.
  3. Choose New Row and provide all the required parameters.

    The Script Owner and Script Name values point to the script that is started from this launch button.

To Launch an Instance of a Script
  1. Access the Launch Table as described in To Access the Script Launcher Module.

  2. Press mouse button 3 on the row displaying the desired script name.

  3. Select Launch Script.

    The script is launched.

To Stop Scripts
  1. Access the Launch Table as described in To Access the Script Launcher Module.

  2. Press mouse button 3 on the row displaying the script you want to stop.

    A pop-up menu appears.

  3. Choose Abort Scripts.

    The script stops running.

Result Table

The Result Table lists all scripts that are currently running or have recently terminated. This table contains the following information:

Every row in the Result Table contains the arguments passed during script invocation, the results produced by the script, and the script exit code. The Result Table also provides information about the current run state, and start and end timestamps.

The Result Table shows the attributes listed in the following table.

Table 5–3 Result Table Attributes

Attribute 

Description 

Run Index 

A unique identifier associated with the script. The value is obtained by prepending launchName with an increasing integer. The integer starts from 0. 

Argument 

The argument supplied to the script when it started. 

Exit Code 

The reason why a script finished execution. The following values are possible:  

  • None – Script is still in initializing or Running state.

  • Halted – Script has been aborted.

  • Successful – Script finished executing successfully.

  • Failed – Script finished execution with an error.

Result Log 

The path to the log file. 

Run Control 

The desired status of the script execution defined by this row (abort or noop). 

Run State 

The script execution status. The following values are possible:  

  • Initializing – The script is initializing.

  • Running – The script is running.

  • Not Running – The script could be in this state because of successful completion, failing, or aborting. The exact reason why the script is Not Running is reflected in the Exit Code field.

Error Log 

The path to the log file. 

Start Time 

The date and time when the execution started. 

End Time 

The date and time when the execution terminated. 

Life Time 

How long the script can execute. If the script has not terminated when this time has expired, the script is killed automatically. 

Expire Time 

How long this row can exist in the Result Table after the script has terminated. This attribute is the value of the Expire Time field of the Launch Table when the script was launched. A script entry is removed from the Result table when Expire Time seconds have passed since the script reached the Not Running state. 

To View the Results From the Result Table
  1. Access the Result Table as described in To Access the Script Repository Module.

  2. In the Result Table, press mouse button 3 on a running script entry.

    A pop-up menu is displayed.

  3. Choose View the Result Log to view the result log file corresponding to the selected running script.

    The Probe Viewer appears, and displays the result of the log.


    Note –

    You can also access log files at the command line. The log files are saved in the /var/opt/SUNWsymon/SysMgmtPack/script-launcher/scripts/UserName/logs directory. The log file name includes the running instance so that the current log file is identifiable when a user runs the same script several times.


To Delete a Row From the Result Table
  1. Access the Result Table as described in To Access the Script Repository Module.

  2. In the Result table, press mouse button 3 on a row.

    A pop-up menu is displayed.

  3. Choose Delete Row.

    A dialog box appears to confirm or cancel the deletion.

  4. Click Yes to confirm.

    Once the row has been deleted, the Run Table is automatically refreshed.