TS/MP Management Programming Manual (G06.24+, H06.03+)
Management Programming Examples
NonStop TS/MP Management Programming Manual—540082-001
15-37
Obtaining Subsystem Information
== Initialize the buffer (spi^buf) with the SSID (subsystem ID) value and
== the command that is to be executed.
SINK [#SSINIT /TYPE 0/ spi^buf [zpwy^val^ssid] [zpwy^cmd^info] &
/OBJECT [zpwy^obj^pathway]/]
== Initialize the ZPWY^DDL^STATUS^PATHWAY token with null values using
== ZPWY^MAP^STATUS^PATHWAY to determine how each field is to be initialized.
== ZPWY^MAP^STATUS^PATHWAY has the information to determine if the fields
== should be nulled to "0" or " ".
SINK [#SSNULL zpwy^map^def^pathway zpwy^ddl^def^pathway]
== To communicate with the PATHMON environment, use #REQUESTER to open the
== Pathway environment. Use #APPENDV to send the request in the SPI
== buffer to the PATHMON environment. Use #EXTRACTV to copy the reply from
== Pathway back into the SPI buffer. Finally, terminate the open request
== to Pathway with #REQUESTER CLOSE.
#SET read^err [#REQUESTER/WAIT [zpwy^val^buflen] / READ &
[pmon^name].#ZSPI io^err reply request]
[#IF read^err |THEN|
#OUTPUT Error [read^err] opening PATHMON [pmon^name]
[#IF not [#EMPTYV io^err] |THEN|
#OUTPUT Error [io^err] is the culprit...
] == end if not [emptyv io^err] ...
|ELSE|
#APPENDV request spi^buf == send the request
#EXTRACTV reply spi^buf == receive the reply
SINK [#REQUESTER CLOSE request]
== Check to ensure no Pathway errors occurred. If an error is encountered,
== display it and stop the run.
#SETMANY result^1 result^2 result^3, [#SSGET/ INDEX 1 /spi^buf
zspi^tkn^retcode]
[#IF ([result^3] > 0) |THEN|
#OUTPUT The INFO PATHWAY command terminated with
#OUTPUT a **[result^3]** ERROR..
|ELSE|
== Now display the results. Use #SSGETV to extract tokens from the SPI
== buffer. In this case, the ZPWY^DDL^STATUS^PATHWAY token is extracted
== using ZPWY^MAP^STATUS^PATHWAY to interpret the token values returned.
== Finally, use #OUTPUTV to display the contents of ZPWY^DDL^STATUS^PATHWAY.
SINK [#SSGETV / INDEX 1 / spi^buf zpwy^map^def^pathway &
zpwy^ddl^def^pathway]
#OUTPUT The INFO PATHWAY command yields the following
#OUTPUT configuration values for the PATHMON system [pmon^name];
#OUTPUT
#OUTPUTV zpwy^ddl^def^pathway
] == end if ([result^3] > 0) ......
] == end if read^err
] == end if not fileinfo /existence/...
] == end if match charfind pmon^name 1 $
] == end if emptyv %1%
#UNFRAME
Example 15-3. Obtaining Subsystem Information Program Example (page2of2)