Previous Topic

Next Topic

Book Contents

Book Index

AutoRefresh Handling

Several products (especially performance monitors) periodically refresh the terminal screen without expecting input from the terminal. This automatic process (AutoRefresh) does not conform to the default KOA information exchange method, as explained in Exchanging Messages.

When a script sends a message to an application, KOA waits until a reply is received. Once the reply is received, the script continues (according to the default method). In order to receive a message from the application without first sending a message (as in the AutoRefresh case), specify command GETSCREEN. This command instructs KOA to receive any immediately available messages from the application. If no messages are currently available, KOA does not wait for a message from the application (as in the default method). Instead, KOA supplies a return code indicating that no message is available. Before retrying the operation, KOA can be instructed to either wait for a specific amount of time, or perform other actions.

The following example demonstrates AutoRefresh handling using OMEGAMON. (Commands /AUPON and /AUPOFF are used to start and stop AutoRefresh.):

Table 22 KOA Sample Script for Handling AutoRefresh using OMEGAMON

Command

Explanation

TYPE `/AUPON’

Type the OMEGAMON command /AUPON at the keyboard.

ENTER

Send the command.

LABEL REFRESH

Specify label REFRESH for script flow branching purposes.

PAUSE 1000

Wait 10 seconds.

GETSCREEN

Receive (accept) any available messages.

IFVAR %VTAMERR EQ `NODATA’ GOTO REFRESH

Determine if special variable %VTAMERR indicates that no messages were available. If no messages were available, proceed to label REFRESH. If messages were available, proceed to the next script command.

SETVAR %CPU SCREEN 7 12 2

Set variable %CPU to the two screen characters at line 7, column 12. At this screen position, CPU usage is displayed.

IFVAR %CPU LT 80 GOTO REFRESH

If CPU usage (%CPU) is less than 80%, branch to label REFRESH.

TYPE `/AUPOFF’

Type the OMEGAMON command /AUPOFF at the keyboard.

ENTER

Send the command.

Continue script processing.

Parent Topic

KOA Implementation Considerations