0

I have a chain with several jobs, and sometimes a certain job that normally takes about 2 hours, finishes in less than 2 minutes.

What I would like to do is to kill this job if it ends in less than 2 minutes so that the chain won't proceed.

Is this possible?

Thanks

Mike Doe
  • 16,349
  • 11
  • 65
  • 88
Pete
  • 3
  • 3

1 Answers1

0

Well you don't really want to kill anything, do you? If you do, see BMC's note (including video) on using ctmkilljob.

In this case your next job is dependent on 2 things, the predecessor job being ok and the duration of the predecessor job. Add another input condition to your next job (in addition to the existing condition) to represent the >2 minutes duration.

On the job that needs to run for more than 2 minutes, add a Notify when the Exectime exceeds 2 mins (or 60 mins or whatever you decide is the threshold) and get it to shout to an entry in your shout destination table.

On the Control-M Server create a new program entry in your shout destination table and create a small script referenced by the shout. The script should use the ctmcontb utility to create a new ODAT condition that your next is waiting on. If you have a look at the BMC help note for ctmkilljob (and just substitute in ctmcontb) then you'll see how to do this.

Mark
  • 316
  • 1
  • 5