Chapter 7. Discovery and alert interfaces 181
7.3.3 Automating NetView alert
This section provides some samples to perform automation on IBM Tivoli
Monitoring for Network Performance events. As discussed in 7.2.3, “Sample
event automation program” on page 173, there are only two event classes
defined for IBM Tivoli Monitoring for Network Performance: threshold exceeded
event and threshold rearmed event.
For NPDA alert, this event content is further hidden in the sub-vector 31 for the
original TEC event, as shown in Figure 7-12 on page 179. This provides a
challenge on writing the automation program.
We make a sample Message Automation Table (MAT) called ITMNP, as shown
in Example 7-7. This MAT is then inserted to the active processing using the
AUTOTBL MEMBER=ITMNP,FIRST command.
Example 7-7 ITMNP sample MAT
*
* ITMNP Event Automation starts here
*
IF MSUSEG(0000) ¬= '' THEN
BEGIN;
IF HIER(3) = 'ITMNP APPL' THEN
BEGIN;
* Common processing for ITMNP events
EXEC (CMD('ITMNPCMD COMMON') ROUTE(ONE +AUTO1)) CONTINUE(Y);
*
* ITMNP_ThresholdExceeded event
*
IF MSUSEG(0000.31(1).30) = . 'ITMNP_ThresholdExceeded' . THEN
EXEC (CMD('ITMNPCMD DOWN') ROUTE(ONE +AUTO1)) CONTINUE(N);
*
* ITMNP_ThresholdRearmed event
*
IF MSUSEG(0000.31(1).30) = . 'ITMNP_ThresholdRearmed' . THEN
EXEC (CMD('ITMNPCMD UP') ROUTE(ONE +AUTO1)) CONTINUE(N);
END;
END;
The automation called the program ITMNPCMD. This is a REXX program that
will parse the actual event content and perform some processing. This sample
ITMNPCMD program is provided in Example 7-8 on page 182.
182 IBM Tivoli Monitoring for Network Performance V2.1: The Mainframe Network Management Solution
Example 7-8 ITMNPCMD sample REXX program
/*REXX*/
/*ITMNPCMD - Automation command to process ITMNP events */
/* Step 1 - Collect MSU information */
event_class = MSUSEG('0000.31(1).30',2)
parse value MSUSEG('0000.31(2).30') with '=' monitor_host ';'
parse value MSUSEG('0000.31(3).30') with '=' source ';'
parse value MSUSEG('0000.31(4).30') with '=' message ';'
parse value MSUSEG('0000.31(5).30') with '=' field_name ';'
parse value MSUSEG('0000.31(6).30') with '=' msmt_detail
parse value MSUSEG('0000.31(7).30') with '=' msmt_id ';'
parse value MSUSEG('0000.31(8).30') with '=' timestamp ';'
parse value MSUSEG('0000.31(9).30') with '=' adapter_host ';'
parse value MSUSEG('0000.31(10).30') with '=' hostname ';'
parse value MSUSEG('0000.31(11).30') with '=' adapter_ip ';'
parse value MSUSEG('0000.31(12).30') with '=' origin ';'
parse value MSUSEG('0000.31(13).30') with '=' thold_id ';'
parse value MSUSEG('0000.31(14).30') with '=' sub_source ';'
parse value MSUSEG('0000.31(15).30') with '=' field_value ';'
parse value MSUSEG('0000.31(16).30') with '=' severity ';'
/* Step 2 - process argument */
parse arg cmd data
select
when cmd='COMMON' then do
/* common processing */
say 'ITMNP event received for' message 'from' monitor_host
end
when cmd='UP' then do
/* UP processing */
end
when cmd='DOWN' then do
/* DOWN processing */
end
otherwise nop
end
exit

Get IBM Tivoli Monitoring for Network Performance V2.1 The Mainframe Network Management Solution now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.