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.
- You have to connect to Control-M Server using Telnet.
- 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".
- 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. - 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:
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