troubleshooting Question

Unix ksh: read/count values in column

Avatar of Watnog
WatnogFlag for Belgium asked on
Unix OSShell Scripting
18 Comments2 Solutions915 ViewsLast Modified:
Dear Expert,

A file is produced at every job failure (ABEND).
Each time the job fails 5 times in a row, we need an action.
So at the 5th time, the 10th time, the 15th time etc.
Like in this case:  

>>every run                                 JOB_X                    SUCC  75 15:19  00:01           0 #J891
 >>every run                                 JOB_X                    SUCC  75 15:21  00:01           0 #J4400
 >>every run                                 JOB_X                    SUCC  75 15:23  00:01           0 #J16712
 >>every run                                 JOB_X                    SUCC  75 15:25  00:01           1 #J27860
 >>every run                                 JOB_X                    SUCC  75 15:27  00:01           1 #J4936
 >>every run                                 JOB_X                    SUCC  75 15:29  00:01           1 #J15944
 >>every run                                 JOB_X                    SUCC  75 15:31  00:01           1 #J27567
 >>every run                                 JOB_X                    SUCC  75 15:33  00:01           1 #J6735
 >>every run                                 JOB_X                    SUCC  75 15:35  00:02           1 #J13349
 >>every run                                 JOB_X                    ABEND 75 15:37  00:01           1 #J20682
 >>every run                                 JOB_X                    ABEND 10 15:39  00:01           1 #J25705
 >>every run                                 JOB_X                    ABEND 10 16:01  00:02           1 #J24643
 >>every run                                 JOB_X                    ABEND 10 16:03  00:02           1 #J12880
 >>every run                                 JOB_X                    ABEND 10 16:05  00:02           1 #J24973; &0:02

So in fact what would need to happen is that the file is read and that a variable is set if the number of times ABEND is reported after the last SUCC is a mutiple of 5.

The very last characters in the snippet are [&0:02] meaning that the job runs every 2 minutes. It would be great if that would be taken into account.
If 'repeat' = 0:02 and 'number_of_ABEND_multiple_of_5' = yes then...

With other jobs the repeat is set differently so we may need to be alerted on 3rd or 2nd ABEND in a row.

Feasable?
Thanks and respect.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 18 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 18 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros