102 Tivoli Business Systems Manager Version 2.1: End-to-End Business Impact Management
? DeleteAppLauncherMenuEntry.sh with arguments:
-n Entry name
-c Class ID
-m Name of menu item
-r Remove parent menu if empty
3.7.2 z/OS subsystems command support
Command support has been predefined for most of the z/OS subsystems, such
as DB2, CICS, or IMS. These commands are send to z/OS through Tivoli
NetView for z/OS with a NETCONV session. Command are invoked using the
program tgmtask from the database server.
As an example, we show the implementation on a single Started Task object with
the MVS Display Active command. The steps are:
1. Define a program to invoke the MVS D A,<stcname> command in NetView. This
must be done because the console reply is asynchronous.
2. Define a stored procedure to invoke the tgmtask command that sends the
command to NetView.
3. Define the stored procedure as a method for the Started Task object.
4. Define the menuitem to invoke the method for a StartedTask object.
NetView command
The NetView command is called MVSDACMD, and its content is shown in
Example 3-3.
Example 3-3 MVSDACMD
/*REXX*/
arg stcname .
'PIPE NETV MVS D A,'||stcname '| CORRWAIT | COLLECT | CONSOLE'
exit
All console commands must be correlated and collected into a single multi-line
message and shown in the console.
Stored procedure
We call the stored procedure _MVSDA. Note the underscore: All stored
procedures that are used as a method for an IBM Tivoli Business Systems
Manager object start with an underscore. The method nameis MVSDA (without
the underscore).
Chapter 3. Database structure 103
Example 3-4 shows the content of the SQL command to create the stored
procedure.
Example 3-4 MVSDA.sql content
CREATE PROCEDURE _MVSDA
@cid ClassID,
@id ObjID,
@ReturnCode INT = NULL OUTPUT
AS
RAISERROR('_MVSDA: %s, %d', 0, 1, @cid, @id)
DECLARE @command NVARCHAR(255)
DECLARE @OSID ObjID
DECLARE @stcname NVARCHAR(8)
IF @cid = 'LOB'
SELECT @cid = phy_cid, @id = phy_id FROM lob_link WHERE dst_id = @id
SELECT @stcname = name FROM STC_V where id = @id
SELECT @OSID = src_id
FROM link
WHERE link_type = 'PHYC'
AND src_cid = 'OS'
AND dst_cid = 'STC'
AND dst_id = @id
AND deleted = 0
IF @OSID is NULL
BEGIN
SELECT '_MVSDA ERROR: Cound not locate OS'
RETURN 8
END
SELECT @command = 'MVSDA ' +@stcname
EXEC @ReturnCode = asisp_tgmtask390 'OS', @OSID, @command
RETURN @ReturnCode
GO
The stored procedure works as follows:
1. The first two arguments must be the Object CID and ID of the method invoker.
The last argument must be the return code for the caller.
2. Declare the necessary variables.
3. If this is a business systems object, try to find the original object that invoked
the method.
4. Obtain the name of the started task that invoked the method.
5. Find the Operating System object to which the started task belongs.
104 Tivoli Business Systems Manager Version 2.1: End-to-End Business Impact Management
6. Construct the command string and pass it to the asisp_tgmtask390 procedure
to invoke it.
Method definition
The method can be defined using SQL commands. We use an SQI file that can
generate the necessary command as shown in Example 3-5.
Example 3-5 Defining MVSDA method: defineMVSDA.sqi
include(BusinessObject.sqi)
BEGIN_METHOD(MVSDA, 'Send MVS D A command','Display Active Task')
METHOD_PARAM(ReturnCode, ASIVARIANT, 'RETURN Code', 'RETURN Code')
METHOD_PARAM_FLAG(output)
METHOD_PARAM(Results, ASIDBTABLE, 'Results', 'Results')
METHOD_PARAM_FLAG(output)
METHOD_PARAM_FLAG(collection)
END_METHOD(MVSDA)
BEGIN_METHOD_CALLERS(MVSDA)
METHOD_CALLER(STC)
END_METHOD_CALLERS(MVSDA)
To translate the file into an executable SQL statement, use the command sh
clsql defineMVSDA.sqi. This will generate the file defineMVSDA.sql that you
can run through the SQL Query Analyzer.
Menu item definition
Now define the menu item by putting the menu in the main context menu and
setting the flags MI_VISIBLESELF, MI_VISIBLELINK and
MI_INVOKEMETHODINTEXTVIEW. Therefore the flag is x50010000 or
1342242816.
Chapter 3. Database structure 105
We use the stored procedure asisp_definemenuitem to do this, and run the query
through the SQL Query Analyzer, as shown in Figure 3-16. Note that we apply
the menu to a specific object with obj_id of 6. If you want to apply the menu to all
objects in that class set obj_id to 0.
Figure 3-16 Running the asisp_definemenuitem
106 Tivoli Business Systems Manager Version 2.1: End-to-End Business Impact Management
Sample result
We implement the command to the GTMPUMP9 started task as shown in
Figure 3-17.
Figure 3-17 Invoke MVS D A
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset