It is currently 21 Jul 2018 9:39


Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: 18 Aug 2012 5:33 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Sep 2008 12:00
Posts: 13
Hello Control-M Experts,

Can someone suggest how I can create a workaround to my issue below:

1. I have a daily job (JobA) when failure occurs, I want to rerun it only 1 time.

2. JobA is set-up:
On Steps tab:
On NOTOK
Do Rerun
Do Mail (to support to fyi them that job will be rerun in next 30 minutes).

On Execution tab:
Not Cyclic
Rerun interval is 30 minutes.
Max Rerun is 1.

On PostProc tab:
When: NOTOK
To: Shout Destination table
Message: Job will be rerun in next 30 minutes

No Issue when:
JobA completes OK after rerun.

Issue is when:
JobA completes NOTOK after doing a max rerun of 1.
-Mail and Shout is sent to support and operations again with same message, however message is not true anymore due to job will not be rerun anymore.

Thank you in advance.


Top
   
PostPosted: 16 Oct 2012 1:59 
Offline
Nouveau
Nouveau
User avatar

Joined: 11 Oct 2007 12:00
Posts: 161
Location: Melbourne
Do you want to notify the support to tell them that the job failed the second time?


Top
   
 Post subject:
PostPosted: 16 Oct 2012 7:19 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Sep 2008 12:00
Posts: 13
Hi brownbag,

Yes, I want to notify support that job failed again for the second (2nd) time and they need to check and investigate.

Thank you.


Top
   
PostPosted: 16 Oct 2012 11:32 
Offline
Nouveau
Nouveau
User avatar

Joined: 11 Oct 2007 12:00
Posts: 161
Location: Melbourne
That is tough, as you want to send a different message depending on the circumstance, and both need to be sent on failure. As you, and many other Control-M users know, there are no nested IFs in the Steps panel. What I would do is take the alerting out of the job itself and instead shout to a script if the job fails (use a shout destination of type P). This script will then handle the alerts. The shout to the script must pass to the program the RUNCOUNT system parameter (and any other parameters you need for the message). The program will then check the value of this and if it is 1, it will send a message saying that the job will be rerun. If it is 2, the message will say that the job failed the second time and needs investigation. The messages can be sent using the ctmshout utility.


Top
   
PostPosted: 05 Nov 2012 6:03 
Offline
Nouveau
Nouveau
User avatar

Joined: 29 Aug 2012 12:00
Posts: 10
brownbag wrote:
That is tough, as you want to send a different message depending on the circumstance, and both need to be sent on failure. As you, and many other Control-M users know, there are no nested IFs in the Steps panel. What I would do is take the alerting out of the job itself and instead shout to a script if the job fails (use a shout destination of type P). This script will then handle the alerts. The shout to the script must pass to the program the RUNCOUNT system parameter (and any other parameters you need for the message). The program will then check the value of this and if it is 1, it will send a message saying that the job will be rerun. If it is 2, the message will say that the job failed the second time and needs investigation. The messages can be sent using the ctmshout utility.


Hello,

that's seems to be a good way.
Have you got an example of this kind of script (call by shout and check RunCount before send a different alarm by mail) ?

Thanks a lot if you can.


Top
   
PostPosted: 06 Nov 2012 10:20 
Offline
Nouveau
Nouveau
User avatar

Joined: 11 Oct 2007 12:00
Posts: 161
Location: Melbourne
Hi,
I don't have any example of such a script - I'm no scripting expert and it does depend on the platform.
But basically it is is an IF/ELSE statement, something like this:
IF $RUNCOUNT = 1 THEN
ctmshout -DEST CTMSUPPORT -MESSAGE "Job failed. It will be rerun"
ELSE
ctmshout -DEST CTMSUPPORT -MESSAGE "Job failed twice. Please investigate"
ENDIF


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited
The site created by Franck YOT. Images, logo, content and trademarks about Control-M products are property of BMC Software.
All the comments are property of their posters. Images, logo, content and design are © copyright by Scheduler-Usage.com. All Rights Reserved