Main Display Script: Pre-Processing
'Tips for developers working within the Sysgem Enterprise Manager (SEM) environment'.
SEM Display, Main Pre-processing Script
Variables set by the SEM framework:
The Perl script: "Pre-processing" (invoked as a SEM Display Window is started) runs on the workstation that started the display.
The purpose of the script is to set initialization parameters before the window is displayed and before the main script runs on the target server.
This section describes the variables that are automatically preset at the start of the script by the SEM framework.
Editing the Pre-Processing Script
The main display Pre-processing script is found in the following place in the SEM Development Interface:
Variables:
The details of the variables stored automatically by the SEM framework at the start of script are shown below.
- Details of the Current SEM User:
Details of the SEM user that has invoked the display are stored in the following Perl variables:
my $USER_NT_USERNAME "Windows NT username" my $USER_NT_COMPUTER "Windows NT computer name" my $USER_SYSGEM_USERNAME "SYSGEM username" my $USER_DISPLAY_VERBOSE "Verbose display option (either 0 or 1)" my $SEM_CLIENT_BUILD "SEM Client Build (e.g. 2.3 4459)"
- Details from the Startup Window:
Details of the Data Entered in the field in the Startup Window are shown in the following variables:
my $INPUT_SV "The Agent(s) selected for connecting to this display" my $INPUT_XX "The values of the fields entered in the startup window - XX is the field code for each parameter field"
- Details of the Authorization Server
my $USE_AUTH_SVR_PROXY "Whether the Authorization Server may be used for DB access (either 0 or 1)" my $AUTH_SVR_ADDRESS "The address of the Authorization Server as used in the SEM Login window" my $AUTH_SVR_PORT "The port number of the Authorization Server as used in the SEM Login window"
'Output from the Pre-procesing Script'
Great care must be taken if outputting any data from the Pre-processing script as all output that is not recognsed by the SEM framework is attached to the main script sent to the target agent for execution as a command.
The following statement produce output that is understood by the SEM framework and is NOT appended to the main Agent script sent to the target server for execution as a command.
print "\@{{ADD_WINDOW_TITLE <text to place in the window's top banner>\n"; # used to display information in the banner
print "\@{{STATUS_BAR_TEXT <text to place in the window's status bar at the bottom of the screen>\n"; # to update the status bar
print "\@{{REMOVE_TREE\n"; # used to initialize the window if the window is an 'explorer' window.
Some initializing is done by having some comment in the pre-processing Perl script. The SEM framework scans the script and will take the necessary action. Examples are shown below:
#
# @{{AUTOSTART_DISPLAY_TITLE Enterprise Accounts
#
The comment above is required to link this display window to a menu option request from another window to start this window.
#
# {{LAYOUT=EXPLORER
# {{EXPLORER_MENU=NO
#
This comment causes the layout of the display window to be an "Explorer" window.
Other printed output recognised by the SEM framework is the output required for displaying a dialogue box. It is possible, for example, to reject the transmission of the script to the SEM Agent by printing an error message in a dialogue box as described in: Dialogue Boxes.
