Chapter 3. Database structure 107
The task parameter window is displayed. As we do not have any parameters, we
just click Start as shown in Figure 3-18.
Figure 3-18 Task setting window
A further prompt asks for the userID and password used to access Tivoli NetView
for z/OS, as shown in Figure 3-19.
Figure 3-19 Tivoli NetView for z/OS prompt
108 Tivoli Business Systems Manager Version 2.1: End-to-End Business Impact Management
The result is presented in the Task Monitor window as shown in Figure 3-20.
Figure 3-20 Task Monitor result window
3.7.3 Tivoli task support
The Tivoli Framework tasks can be invoked using the tgmtask command:
tgmtask -h eehost -u tmeid -k tmepw {-o tmeendpointoid|-r endpointhostname}
tskname|tsklib|tskargs
where
eehost The event enablement or task server hostname
tmeendpointoid Object id of the endpoint, in the format of
<tmr num>.<dispatcher num>.0+
endpointhostname Endpoints label
tmeid, tmepw User ID and password to access the TMR
task information Task name, task library name, and task arguments
Chapter 3. Database structure 109
With this capability, we can extend the menu for any distributed objects that we
can identify as belonging to a Tivoli Management Region where a task server is
defined. For simplicity, we define additional commands for resources that are
defined from TEC, where an Event Enablement host is one of the attributes.
We pick up a generic object that is defined as cid of G02K and add an extension
to perform a DIR command on a Windows platform or a df command on a UNIX
platform.
The tasks are similar, except that we create a Tivoli Framework task called
DIRCDrv under TBSMTasks Task Library. The script that the task runs is shown
in Example 3-6.
Example 3-6 Shell script for DIRCDrv task
#!/bin/sh
if [ x"$OS" = x"Windows_NT" ] ; then
CMD.EXE /C DIR C:
else
df
fi
exit 0
We then define a stored procedure called _DIRCDrv as shown in Example 3-7.
Example 3-7 _DIRCDrv Stored Procedure
CREATE PROCEDURE _DIRCDrv
@cid ClassID,
@id ObjID,
@ReturnCode INT = NULL OUTPUT
AS
RAISERROR(‘_DIRCDrv: %s, %d’, 0, 1, @cid, @id)
DECLARE @command NVARCHAR(255)
DECLARE @userID NVARCHAR(255)
DECLARE @tmeid NVARCHAR(255)
DECLARE @epname NVARCHAR(255)
IF @cid = ‘LOB’
SELECT @cid = phy_cid, @id = phy_id FROM lob_link WHERE dst_id = @id
SELECT @tmeid = _EEhost, @epname = _MgedSystemName
FROM G02Kcname_V where id = @id
EXEC asisp_getContextUserID @userID OUTPUT
IF @tmeid is NULL
BEGIN
SELECT ‘_DIRCDrv ERROR: Cound not locate EE host’
RETURN 8
110 Tivoli Business Systems Manager Version 2.1: End-to-End Business Impact Management
END
SELECT @command = ‘tgmtask -d TME -h “‘ + @tmeid + ‘” -r “‘ + @epname + ‘” ‘
IF @userID IS NOT NULL SET @command = @command + ‘ -u “‘ + @userID + ‘” -k
“********” ‘
SET @command = @command+’ “DIRCDrv|TBSMTasks|’
EXEC @ReturnCode = master..xp_cmdshell @command
RETURN @ReturnCode
GO
We then use DefineDIRCDrv.sqi file to define the method for G02K as shown in
Example 3-8.
Example 3-8 DefineDIRCDrv.sqi
include(BusinessObject.sqi)
BEGIN_METHOD(DIRCDrv, ‘Dir of C drive’,’Display C Drive’)
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(DIRCDrv)
BEGIN_METHOD_CALLERS(DIRCDrv)
METHOD_CALLER(G02K)
END_METHOD_CALLERS(DIRCDrv)
We run the command sh clsql DefineDIRCDrv.sqi and invoke SQL Query
Analyzer to load the generated DefineDIRCDrv.sql.
Then we run asisp_definemenuitem against the G02K object. This time we apply
to all instances using the command:
EXEC asisp_definemenuitem 'DIRCDrv', 'G02K', 0, 'DIR C Drive', NULL, NULL,
'DIRCDrv', NULL, '', 1342242816
Chapter 3. Database structure 111
The resulting menu item is shown in Figure 3-21.
Figure 3-21 Context menu for DIRCDrv
..................Content has been hidden....................

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