Email alert on third failure

All questions about Control-M jobs definitions
Post Reply
User avatar
vamsikumar
Nouveau
Nouveau
Posts: 10
Joined: 23 Aug 2013 12:00
Location: Banglore

Email alert on third failure

Post by vamsikumar » 17 Mar 2014 8:57

Hello All,

i have one requirement. kindly some one please help.

we have one job which is scheduled to run daily.

If the job failed for 1st time, it should rerun.
Again for 2nd time fails, again it should rerun.

If the job third time fails, then, need an email to group of people.

Kindly advise me how can i fulfill this requirement.

Regards and Thanks in Advance!!
Vamsi Kumar

User avatar
GrahamH
Nouveau
Nouveau
Posts: 30
Joined: 20 Jan 2006 12:00

Post by GrahamH » 17 Mar 2014 11:40

This requirement is a standard feature of Control-M V8.

User avatar
sunuriyal
Nouveau
Nouveau
Posts: 27
Joined: 18 Jan 2014 12:00

Post by sunuriyal » 17 Mar 2014 12:59

I think only the option with version 7 is. You set the alerts for all the failures and disregard first two :)

User avatar
ThePirate
Nouveau
Nouveau
Posts: 61
Joined: 04 Feb 2008 12:00
Location: Cleveland, OH

Post by ThePirate » 17 Mar 2014 3:56

Use Steps Panel: ON Statement: *
Code: RUNCOUNT=3
DO Mail
Also change Maxreruns = 2 on the Execution Panel if you don't want it to keep rerunning past this point.

User avatar
vamsikumar
Nouveau
Nouveau
Posts: 10
Joined: 23 Aug 2013 12:00
Location: Banglore

Post by vamsikumar » 18 Mar 2014 7:35

Hello,

In this case, we will get an email even the 3rd is successful. we need if 3rd run failed, then only we need email.

If 3rd run is success, no email or any other actions required.

Thanks in advance!!

User avatar
ThePirate
Nouveau
Nouveau
Posts: 61
Joined: 04 Feb 2008 12:00
Location: Cleveland, OH

Post by ThePirate » 18 Mar 2014 7:52

At least you know that it has failed at least twice. Add a note in the email to review the attached sysout to determine if it has failed on this run. You then need to change the parameter in DO MAIL Attach sysout = YES.

There is only so much you can do with the job definition. It is limited because the Steps panel does not allow ON (*) and ON (*). If it did you could code ON * COMPSTAT=1 AND ON * RUNCOUNT=3 DO.... but this is not possible. We have the production support team review the job/email on the third run to determine success. At some point you will need to do some manual intervention anyway if it keeps failing.

User avatar
SKSKD
Nouveau
Nouveau
Posts: 9
Joined: 12 Aug 2013 12:00

Post by SKSKD » 27 Apr 2014 9:30

Hi you can use this

ON * RUNCOUNT=3,NOTOK DO.... MAIL...

User avatar
jCarlos
Nouveau
Nouveau
Posts: 36
Joined: 19 Jun 2013 12:00

Post by jCarlos » 27 Apr 2014 2:55

Hello, I just tested what SKSKD said and it worked for me, you should try it.

i'm using a solaris enviroment so i have created a simple script

Code: Select all


user@server # cat ./prueba
#!/bin/bash
echo TERMINOMAL

and the job like this:

Code: Select all


[ON] Statement = *
        Code= RUNCOUNT=3,TERMINOMAL
[DO] NOTOK

so, in your case it should work like this:

get your error message: eXAMPLEerr

Code: Select all


[ON] Statement = *
        Code= RUNCOUNT=1,eXAMPLEerr
[DO] Rerun

[ON] Statement = *
        Code= RUNCOUNT=2,eXAMPLEerr
[DO] Rerun

[ON] Statement = *
        Code= RUNCOUNT=3,eXAMPLEerr
[DO] Mail \\and fill the mail parameters



you can add [DO] NOTOK on each failure or the last one, that's on your behalf

regards,

User avatar
ThePirate
Nouveau
Nouveau
Posts: 61
Joined: 04 Feb 2008 12:00
Location: Cleveland, OH

Post by ThePirate » 28 Apr 2014 3:30

I have been coding for seven years and never knew you could use it that way. I even opened a ticket with BMC in the early years because there was a note in the manual stating you could perform an On * AND On * of which they determined was a misprint. I am the only Control-M person at my company and have no one to discuss issues with therefore the Forum. Thanks SKSKD and everyone that contributes to the Forum.

Post Reply