Showing posts with label Control-M Desktop. Show all posts
Showing posts with label Control-M Desktop. Show all posts

Sunday, January 5, 2014

How to Add a Condition using SHOUT (POSTPROC)

As most of us know that we can add conditions using "Conditions" tab or through steps tab.  Normally we can add/remove conditions based on the below scenario's.
  • When job Ended OK (using Conditions Tab)
  • When the job Ended NOTOK (using Steps Tab)
  • When a job failed with a specific return code (using Steps Tab)
  • When you find a particular string in Log/Sysout (using Steps Tab)
  • When Run Counter criteria met (using Steps Tab)
... there might be many other scenario's where we may need to add/remove conditions. few of them are When a job executing for longer time, or If the job not submitted by a particular time or If the job not completed by a certain time. In general we will trigger an ALERT in these scenario's using PostProc tab. Now I'm going to explain you how can we add a condition instead of generating an alert.

Like how we use LateTime/ExecTime/LateSub, we'll goto PostProc tab and select the particular event which you would like to check and add a condition.

A SHOUT WHEN EXECTIME > nnn (The range is 001 to 999 in minutes only) or 
A SHOUT WHEN LATE SUB > HHMM or 
A SHOUT WHEN LATE TIME > HHMM

If you want to Average time then use + and you can also use % (percentage) to limit above the average time.

Here is the example:



"condition" must be added in the shout destination table as a script i.e program as destination. You can name as you desire (something like add-condition.sh). The script should contain the below statement to add the condition.

ctmcontb –add $2
The ctmcontb utility performs different operations on prerequisite conditions in the Control-M/Server database (Like Add, Delete, List conditions).

In the same way you can also invoke any other utility depend upon the requirement.

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).

Wednesday, July 10, 2013

How to get a job to email the SYSOUT



Update the STEPS panel of the failing job with the following statements:

      On Stmt=*            Code=COMPSTAT!0 (or NOTOK or other specific return codes)
      DO Set-Var          %%\G_ORDERID                %%ORDERID
      DO Set-Var          %%\G_JOBNAME               %%JOBNAME
      DO Set-Var          %%\G_MAILADDRESS      youremail@domain.com
      Do Force-Job      Table=YourTable                 Jname=EMAILSYSOUT

Note: The “Do Set-Var” is setting global variables to be passed to another job. Global variables are defined using a backslash.
The global variables are used in the other job without the backslash.


Force job definition: Job name EMAILSYSOUT

On the command line:
ctmpsm -LISTSYSOUT 000%%G_ORDERID |mailx -s "Job %%G_JOBNAME failed. See sysout attached!" %%G_MAILADDRESS


Note: The Node-id on the Execute tab must be the home server for Control-M.


Wednesday, November 21, 2012

Using Wild card in File Watcher [ctmfw ]

Most of us know that ctmfw utility is used for File Watcher (create/delete). Normally most of us (all of us.. may be ???? I've used many times before knowing the exact usage ;-D ) will use the file name in quotes (" "), which is actually wrong. The correct way of using this is , placing the quotes only with the file name not with entire path.

Invalid: "test/mahi/touchfile.txt"

Valid: test/mahi/"touchfile.txt"

This will be very helpful while using wildcard character (*)

Eg: test/mahi/"touchfile*.txt"

This will give a flexibility to watch for any file like touchfile1.txt, touchfile2.txt, touchfile-random.txt... etc

Tuesday, November 20, 2012

May be Conditions (Manual Conditions)

Sometimes we will get different scenarios in Scheduling control-M jobs, one of that is like below.

Lets say there are JOB-A,JOB-B,JOB-C. JOB-C, is dependent on other 2 jobs.
  • If JOB-A & JOB-C are DAILY Jobs
  • JOB-B is Mon, Wed, Fri job 
If you try to implement the above change the first thing comes to your mind is using DUMMY job (in case if you are good in Scheduling though).

if it is a single scenario in your entire batch jobs then we can use Dummy jobs, lets say you have 100's of similar scenarios. then it would be difficult to have 100's of dummy jobs, it will make your scheduling solution complex, so it is better to use May Be Conditions or Manual Conditions.

Steps to Implement this:

  1. Out Conditions of JOB-A and JOB-B should be  #-JOB-A-OK and   #-JOB-B-OK
  2. In  Conditions of JOB-C is  #-JOB-A-OK and   #-JOB-B-OK
  3. Create 1 job with TASK TYPE as Command and use "ctmldnrs -CALCCOND -ADDMODE NO" as a commad
  4. Create 1 job with TASK TYPE as Command and use ctmldnrs -LOAD "#-*" as a commad
The job in Step3 will create a default output file in <controlm_user_dir/ctmldnrs.dat>

The job in Step4 will read the conditions from a default file <controlm_user_dir/ctmldnrs.dat> and load it on Conditions table. This means the jobs which are not in schedule for that day and if there are any jobs waiting for their conditions (#- Conditions) will be created in Conditions table.

Note:
  • Step3 job must run immediately after New Day Process
  • Step4 job must run after Step3 job
I hope it is clear. Please drop your comments in case if you have any queries.

Saturday, March 10, 2012

Control-M Desktop Collection Feature to Mass Update


The purpose of this article is to provide information on how to do a mass update on a group of jobs using the Job Collections feature in Control-M Desktop.


I just would like to give step by step process using pictures to guide any one who is new to Control-M scheduling.


The version of Control-M used here is 6.3.01



Click on “View -> Filter…” or click on “Filter…” Icon on standard Toolbar



 It will display the Filter dialog box. Enter your filtering criteria and click on OK when finishes. (In this example I’m filtering the jobs start with ‘job’)





All the jobs are still there but only the ones from the collection will show or be affected by Mass Updates. To change the draft back to all jobs select View / Filter then ‘Select the Full Draft’.



Go to ‘Edit -> Find and Update…’ or click the  Icon on standard toolbar.




   
This will display ‘Find and Update’ dialog box, enter your criteria and click on ‘OK’. Here I'm changing the group to ‘test’. Make sure ‘Collection’ radio button is selected else all the jobs in the draft with the matching criteria will be changed.





Now you can select the full draft in the ‘Filter’ window to have look at entire table.



I hope this gives you some sort of idea how do a mass update. The dialog boxes may differ from version to version.

Share with your friends and colleagues if you like my site.

Cheers,
Mahi

Thursday, February 23, 2012

Find jobs in Control-M




To find jobs in the flow diagram that conform to specific criteria
  1. In CONTROL-M/Desktop or CONTROL-M/EM, select Edit => Find Jobs.
  2. In the Find Job dialog box, fill in the criteria (you can specify pattern-matching strings in certain fields).
  3. In CONTROL-M/EM only, to save the specified Find criteria for future use, assign a name in the Find Presets field, and click Save.
  4. Click Find, which selects all nodes matching the criteria, and displays the first node that fits the criteria.
To change the focus (navigate among multiple selected nodes)

Click the appropriate navigation button (First)  , (Previous) , (Next) , or (Last) ,  or use the View => Toggle Selection menu.

Tuesday, August 30, 2011

Control-M GUI's


GUI’s:

          The main 3 GUI’s are listed below.

ü  Control-M / EM
ü  Control-M Desktop
ü  Control-M Configuration Manager


Control-M / EM:

This is a GUI where we can view all the jobs which are running for today. The jobs which are active for today is called ‘Active Job File (AJF)’.


Control-M Desktop

Using this GUI you can make all permanent changes to scheduling tables and calendars. You can create new jobs, tables and calendars using Control-M desktop. The changes which you are performing through this will be permanently stored in control-M server database.


Control-M Configuration Manager

Through this GUI you can monitor all control-m components (Control-M server, agents, remote hosts… etc) health status. You can also implement additional security using this GUI. We can define agents, Remote Hosts through this GUI.  

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Awesome Deals | Bloggerized by Mahendra - 24x7FunOnline