Information about an event can be forwarded to NetView for z/OS® using the MVS MODIFY
command.
About this task
A second way to cause a situation event to forward information
about the event to NetView for z/OS is to specify a MVS
MODIFY
(F) command in the System Command input field
of the situation's Action tab. The MODIFY command must specify
the NetView procedure name
and the name of the REXX exec that you want to run. This MODIFY command
causes the REXX exec to run in the NetView address
space. A limitation of this method is that MVS console commands are limited to 126 characters.
Do
the following to set up the Mainframe Networks monitoring agent to
use the MVS MODIFY command to
forward situation event information to the NetView program.
Procedure
- Follow the same procedure described in Step 1 of Method
1 for opening the Situation Editor, selecting a situation, creating
another situation based on it, and clicking on the Action tab.
In the System Command field, specify an
MVS MODIFY
command,
as in this example:
F NetViewProcName,KN3SITEX
When
the MVS MODIFY
command is executed, the command that
follows the NetView application
procedure name (in the case KN3SITEX
) is executed
in the NetView address space
within one of the program's autotasks.
As in the previous method,
you can use the Attribute Substitution button to pass attribute values
to the command, as in this example:
F NetViewProcName,KN3SITEX N3A_Sample_NetViewAuto_Cmd CPUPercentage
&{TCPIP_Address_Space.CPU_Percentage}
In these examples,
KN3SITEX
,
is a REXX exec that is saved in a member of a data set specified on
the DSICLD DD statement of the NetView application
startup procedure.
KN3SITEX
can be replaced by any NetView command you may want
to issue when the situation triggers.
- Develop a REXX exec to process the situation event information.
The following code sample assumes that the input to the exec is a
situation name followed by attribute name/value pairs.
This code can be found in the KN3SITEX file in the
&thilev.TKANSAM SMP/E target
data set:
/* REXX
*********************************************************************
*
* NAME(KN3SITEX)
*
* This REXX exec is an example of how an IBM Z OMEGAMON Network
* Monitor situation might be processed in the NetView address space.
* The exec parses the arguments and displays them.
*
* The input to this exec is a string with the name of the situation
* that fired followed by <attributeName attributeValue> pairs. For
* example:
*
* situationName attributeName1 attributeValue1
* attributeName2 attributeValue2
* ...
* attributeNamex attributeValuex
*
* The attribute names may not have parenthesis characters in them.
*
* The input data is provided by an MVS command specified in the
* System Command input field found in the Action tab for an
* IBM® Z OMEGAMON® AI for Networks situation. The MVS command
* can be:
*
* - A SEND command. The message text provided contains the
* expected input.
* - A MODIFY NetViewProcName,KN3SITEX with inputs as described above.
*
* The total number of characters in the input string will always be
* 126 or less. This is the maximum number of characters that an MVS
* console command can have. Characters beyond this limit will be
* truncated by MVS and will never be seen by this exec.
*/
TRACE O
PARSE ARG sitName attributes
IF sitName = '' THEN
SAY 'Error, no situation name in input';
ELSE
DO;
SAY 'IBM® Z OMEGAMON® AI for Networks situation' sitName 'received';
IF attributes = '' THEN
DO;
SAY 'No attributes passed for situation'
END;
ELSE
DO;
DO WHILE(attributes ^='')
PARSE VAR attributes attrName attrValue attributes
/* Make sure attribute name does not have any parenthesis */
IF (POS('(', attrName) = 0) & (POS(')', attrName) = 0) THEN
SAY attrName attrValue;
END;
END;
END;
EXIT;
If
you want to generate an SNMP TRAP in your EXEC, see the IBM®
Tivoli
NetView for z/OS:
Command Reference book for more information.
If you want to forward the situation event
and cause a trouble ticket to be created, look at sample CNMSIHSA in the NetView DSIPARM data set. The default automation table contains a commented
out %INCLUDE for this member. See also the NetView for z/OS documentation describing the Event/Automation Services
(E/AS) and their functions.
- Save your debugged exec to a member in a data set specified
on the NetView application
startup procedure DSICLD DD statement. To be able to access your
REXX exec without having to recycle the NetView program, you can issue NetView commands,
REACC DSICLD
and LOADCL execName,(REPLACE)
.