TS/MP Management Programming Manual (G06.24+, H06.03+)
Management Programming Examples
NonStop TS/MP Management Programming Manual—540082-001
15-35
Obtaining Subsystem Information
Obtaining Subsystem Information
Example 15-3 presents a management program that issues an INFO PATHWAY
command. The example is a TACL macro written as an SPI requester and:
1. Determines whether the PATHMON process name is provided and checks that the
name is in a valid format
2. Loads the ZSPITACL and ZPWYTACL token definitions
3. Defines the SPI buffer
4. Sets the SSID value
5. Initializes the buffer and the ZPWY-DDL-STATUS-PATHWAY token
6. Opens the Pathway subsystem, sends and receives the buffer, and closes the
buffer
7. Checks for Pathway subsystem errors
== If an error is encountered, open the error list in the response buffer
== for access, extract the command from the response buffer, and extract the
== object type from the response buffer.
[#IF ([result^3] > 0) |THEN|
#OUTPUT The [command^] command terminated with an
#OUTPUT Error **** [result^3] ****
SINK [#SSGET/ INDEX 1 /spi^buf zspi^tkn^errlist]
#SETMANY j^1 j^2 res^cmd, [#SSGET/ INDEX 1 /spi^buf
zpwy^tkn^reqcommand]
[#IF [#MATCH [res^cmd] [zpwy^cmd^add]] |THEN|
#OUTPUT ZPWY^TKN^REQCOMMAND = ZPWY^CMD^ADD
|ELSE|
#OUTPUT ZPWY^TKN^REQCOMMAND = ZPWY^CMD^ALTER
] == end if match res^cmd .....
#SETMANY j^1 j^2 res^obj, [#SSGET/ INDEX 1 /spi^buf
zpwy^tkn^reqobjecttype]
[#IF [#MATCH [res^obj] [zpwy^obj^sc]] |THEN|
#OUTPUT ZPWY^TKN^REQOBJECTTYPE = ZPWY^OBJ^SC
|ELSE|
#OUTPUT Unable to identify OBJECT TYPE.
] == end if match res^obj .....
|ELSE|
SINK [#SSGETV/ INDEX 1/ spi^buf zpwy^map^sel^sc
zpwy^ddl^sel^sc]
#OUTPUT The server name listed below has been [command^]ED !!!
#OUTPUT
#OUTPUTV zpwy^ddl^sel^sc
] == end if result^3 > 0 .....
] == end if read^err .....
] == end if not fileinfo /existence/....
] == end if [r_format_server_name %3%] .....
] == end if [r_command_ok %2%] .....
] == end if r_valid_pmonname %1% .....
] == end if [empty %*%] .....
#UNFRAME
Example 15-2. Adding or Altering a Server (page 5 of 5)