Hi Dave,
This is what I observed when I was doing testing in the AOF TEST environment.
I had been using OPSTHRSH quite nicely, until I started doing some testing in AOF TEST.
------ I have now tested in AOF proper, and the OPSTHRSH is doing what I expected. ----- Good.
If msg.id = "MVAD003S" then
do
acnt = opsthrsh('A',120)
say 'acnt = 'acnt
end
If msg.id = "MVAC004S" then
do
bcnt = opsthrsh('A',120)
say 'bcnt = 'bcnt
end
------ I have now tested in AOF proper, and the OPSTHRSH is doing what I expected. ----- Good.
These are what I did in AOFTEST environment that confused me.
Setup: All messages coming from same address space.
If these message come from the same address then acnt and bcnt just increment per message, so if 4S came in twice, acnt = 2, then a 5S comes in the bcnt = 3 (not 1) then a 4s comes in the anct is now 4 (not 3).
If msg.id = "MVAC004S" then
do
acnt = opsthrsh('A',60)
end
if msg.id = "MVAC005S" then
do
bcnt = opsthrsh('A',120)
end
If these message come from the same address then acnt and bcnt reset if the criteria are met, so if 4S came in twice, acnt = 2, then a 5S comes in the bcnt = 1 (acnt resets to 0) then a 4s comes in and acnt is now 1 (not 3) the bcnt is reset to 0.
If msg.id = "MVAC004S" then
do
acnt = opsthrsh('A',60,'MVAC004S')
end
if msg.id = "MVAC005S" then
do
bcnt = opsthrsh('A',120,'MVAC005S')
end
If these message come from the same address then acnt and bcnt just increment per message, so if 4S came in twice, acnt = 2, then a 5S comes in the bcnt = 3 (not 1) then a 4s comes in the anct is now 4 (not 3). Same result as scenario one with the E type of opsthrsh.
If msg.id = "MVAC004S" then
do
acnt = opsthrsh('C',60,'MVAC004S')
end
if msg.id = "MVAC005S" then
do
bcnt = opsthrsh('C',120,'MVAC005S')
end
Thanks
Mark
Original Message:
Sent: 08-09-2021 08:44 AM
From: Dave Gorisek
Subject: Re: Tuesday Tip: Mirror Mirror on the Wall what is the best OPS/MVS variable of all?
Multiple OPSTHRSH() type functions can be used in a rule. This is useful then thresholding on events caused by different asids and you want to threshold by 'how many' on the system or 'how many' by a specific jobname/asid. For example, in the IEA611I SVC Dump event rule, we threshold by the number of abends occurring on the system ('E'vent threshold) and by the jobname/asid that abended (using jobname within a 'C'riteria threshold) when we want to threshold on dumps from the same jobname. Would really need to know the exact event and 'outcome' you are expecting to see to determine what is the best logic needed within the rule. It sounds as if you may have a generic msg rule (such as )MSG IEF*). If so , keep in mind that if you have something like )MSG IEF* - msgid IEF123I would have its 'own' counters, msgid IEF456I would have its 'own' counters, etc . Best way to make sense of it all, is to enable some test rule with all the threshold events, and issue the test WTO from your TSO ID via TSO OPSWTO MSGID(testmsg) Text('Text of msg here') and then from either a pgm or OPSWTO running in a server or from batch to see the counts dumped from your test rule as they are issued from different asids. Test rule may look something like:
)MSG DAGTEST*
)Proc
/* How many times did this triggerring msg id occur from any asid */
E_thresh_cnt = OPSTHRSH('E','600')
say ' E_Thresh_cnt for 'msg.id'='E_thresh_cnt 'issued by 'msg.jobname
/* How many times did this triggerring msg id occur from this asid */
A_thresh_cnt = OPSTHRSH('A','600')
say ' A_Thresh_cnt for 'msg.id'='A_thresh_cnt 'issued by 'msg.jobname
/* How many tmes did this triggerring msg id have ABCDEF from any asid*/
c_thresh_cnt = OPSTHRSH('C','600','ABCDEF')
say ' C_Thresh_cnt for 'msg.id'='C_thresh_cnt 'issued by 'msg.jobname
Original Message:
Sent: 08-08-2021 08:38 PM
From: Mark Noonan
Subject: Re: Tuesday Tip: Mirror Mirror on the Wall what is the best OPS/MVS variable of all?
Hi Carlos,
Can OPSTHRSH be used multiple times in one rule?
if example:
if msg = A
do
cnt = opsthrsh .......
end
if msg = B
do
another_cnt = opsthrsh .......
end
if cnt = 4 then ...........
if another_cnt = 8 ..........
Thanks,
Mark
Original Message:
Sent: 07-17-2018 11:58 AM
From: Carlos Mario Silveira Filho
Subject: Re: Tuesday Tip: Mirror Mirror on the Wall what is the best OPS/MVS variable of all?
Hi Steve,
The recommend method to avoid repetitive actions from rules is the usage of the function OPSTHRSH. This is a relatively new function (added in OPS 12.2) so, in the past, it was necessary to keep the counter in static variables of AOF rules.
Just for reference for who may have interest in this function, more information can be found in the link below:
OPSTHRSH Function - CA OPS/MVS® Event Management and Automation - 13.0 - CA Technologies Documentation
Regards,
Mario
Carlos Mario Filho
Principal Support Engineer