Thursday, July 11, 2013

How to KILL a Job using PostProc Tab



During our day to day activities sometimes we may come across a scenario to Kill a job during run time. The most commonly scenario is to kill a job when it is exceeding its normal time limit. We can achieve this using PostProc tab without any manual intervention.

To perform this you MUST have access to Control-M Server.
  1. You have to connect to Control-M Server using Telnet.
  2. From the "ctmsys" menu, goto "Shout Destination Tables" and define a shout destination with type "P" (process), Address Type "A" (agent), Logical Destination "Kill_Job" and Physical Destination"$HOME/ctm/exe_<architecture>/killjob.sh".
  3. Go to your CONTROL-M/Server home directory, and define a script under ctm/exe_<architecture>/. The script name will be "killjob.sh", which contains the following lines:

    #!/bin/csh
    ctmkilljob -ORDERID $2 &


    Note: the ampersand (&) at the end of the command. This must be present for this solution to work.
  4. Job definition
    • Goto the "PostProc" tab and define a shout WHEN LATETIME or EXECTIME
    • in the Destination put "Kill_Job
    • in the Message Box put "%%ORDERID" (the parameters for the "killjob.sh" script).

1 comments:

barbu said...

Thanks this is very usefull, but take care, while upgrading Control-M Server, your script will pass away. You'd better place it in a specific folder.
Regards

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Awesome Deals | Bloggerized by Mahendra - 24x7FunOnline