TS/MP Management Programming Manual (G06.24+, H06.03+)

Management Programming Examples
NonStop TS/MP Management Programming Manual540082-001
15-33
Adding or Altering a Server
[#IF [#EMPTYV T^svr^name] |THEN|
#RESULT 0
#OUTPUT You must supply a valid server name !!!!
|ELSE|
#RESULT 0
#OUTPUT Unexpected argument in [#ROUTINENAME]: [#REST]
] == end if [emptyv t^filename] .....
] == case [argument /text T^svr^name/ ......
#UNFRAME
] == end def r_format_server_name .....
== Enter call routines to ensure that the PMONNAME, server name, and command
== are correct.
[#IF [#EMPTY %*%] |THEN|
#OUTPUT The correct syntax to add/alter a server class is:
#OUTPUT SPISCAA $PATHMONNAME COMMAND SERVERNAME
|ELSE|
[#IF [r_valid_pmonname %1%] |THEN|
[#IF [r_command_ok %2%] |THEN|
[#IF [r_format_server_name %3%] |THEN|
== Load the ZSPITACL and ZPWYTACL token definitions. These definitions
== can also be loaded into a TACL SEGMENT file and attached to the user’s
== environment. This saves considerable time if this macro is used
== regularly. The files ZSPITACL and ZPWYTACL must reside on $DSV.ZSPIDEF.
[#IF NOT ([#FILEINFO/ EXISTENCE / $SYSTEM.ZSPIDEF.ZSPITACL] AND
[#FILEINFO/ EXISTENCE / $SYSTEM.ZSPIDEF.ZPWYTACL]) |THEN|
#OUTPUT *ERROR* Unable to load ZPWYTACL or ZSPITACL definition files
#OUTPUT *ERROR* Insure that these files reside on $SYSTEM.ZSPIDEF...
|ELSE|
#OUTPUT Loading ZSPITACL DDL
#LOAD / LOADED X^ / $SYSTEM.ZSPIDEF.ZSPITACL == copy tacl spi ddl defs
#OUTPUT Loading ZPWYTACL DDL
#LOAD / LOADED Y^ / $SYSTEM.ZSPIDEF.ZPWYTACL == copy tacl pwy ddl defs
== Define the SPI buffer.
[#def spi^buf struct like zpwy^ddl^msg^buffer;]
== Set the SSID (subsystem ID) value, which tells SPI what product you are
== interfacing with.
#SET zpwy^val^ssid [zspi^val^tandem].[zspi^ssn^zpwy].[zpwy^val^version]
== Initialize the buffer (spi^buf) with the SSID value and the command
== that is to be executed.
SINK [#SSINIT /TYPE 0/ spi^buf [zpwy^val^ssid]
[zpwy^cmd^[command^]] /OBJECT [zpwy^obj^sc]/]
== Initialize the ZPWY^DDL^SEL^SC token with null values using
== ZPWY^MAP^SEL^SC to determine how each field is to be initialized. That
== is, ZPWY^MAP^SEL^SC has the information to determine if the fields should
== be nulled to "0" or " ".
SINK [#SSNULL zpwy^map^sel^sc zpwy^ddl^sel^sc]
SINK [#SSNULL zpwy^map^def^sc zpwy^ddl^def^sc]
Example 15-2. Adding or Altering a Server (page 3 of 5)