12
Note: This was\is being designed for the specific needs of a specific client. But it may help you in the very basic basics of Control-M version 7 or previous versions. Now I just got a preview for Control-M version 8 and it is a completely different GUI. Still same basic concepts but some of the basic operations and functions have changed identity. I'm sure I'll have stuff on 8 later ..... Control-M 7 Basics This is currently a Work In Progress. Ignore any spelling errors or anything else really. Consider it a draft. Thanks. The goal of this guide is to provide a jump in point for Control-M. It is going to cover only the basic understanding of Control-M to allow someone with very little scheduling knowledge to jump into creating and uploading test jobs and learn on the fly. Disclaimer: When in doubt read the manual. BMC provides very easy to read manuals (compared to other applications) they are full of details and tidbits you just wont find anywhere else. I would have to say Control-M is very user intuitive and you can use the manuals as a great reference for any issues that arise. What is covered? How Control-M works Parts of Control-M How to create a job How to upload a table How Control-M works: A basic overview of Control-M requires you to only know 3 parts. The Control-M Data Center, The Agent, and Your server. Basically the Data Center is the Servers that Control-M itself resides on. There are several parts to these servers but it is not necessary for you to know this. Just understand the data center is where your jobs are contained. The Agent is a Control-M component that resides on your server. (there is agent less ability in Control-M 7+) The agent gives you many of the features Control-M offers and acts as a translator between the Data Center and your server. Your Server is where all the actual processing is done. Your scripts reside there that Control-M will trigger and monitor, or it is where commands are issue to from Control-M. Aging this is a very basic understanding of the way control-M works. There are several Servers combined housing various parts of Control-M its database and attached storage. Parts of Control-M. By parts I am referring to the interfaces you will use, GUI's or applications. Average users will use only two of these, Desktop and Enterprise Manager. There are however other interfaces like Configuration manager, Reporting facility and BIM. For the purpose of this we will cover Desktop and Enterprise Manager (EM). Desktop Desktop is used to create Tables and jobs. You will do all of you actual manipulation of the jobs in Desktop. If you were building a chair it would be the workshop you would cut and assemble the pieces. Enterprise Manager (EM) EM is where you follow your job and manipulate it daily. It is where if a job was scheduled to run and you wanted to hold it you would do so. If Control-M 7 Basics Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic 14 of 25 12/1/2013 10:18 PM

Learn While I Learn Control-M

Embed Size (px)

DESCRIPTION

control m

Citation preview

Page 1: Learn While I Learn Control-M

Note: This was\is being designed for the specific needs of a specific client. But it may help you in the

very basic basics of Control-M version 7 or previous versions. Now I just got a preview for Control-M

version 8 and it is a completely different GUI. Still same basic concepts but some of the basic operations

and functions have changed identity. I'm sure I'll have stuff on 8 later.....

Control-M 7 Basics

This is currently a Work In Progress. Ignore any spelling errors or anything else really. Consider it a draft.

Thanks.

The goal of this guide is to provide a jump in point for Control-M. It is going to cover only the basic understanding of Control-M to allow someone with

very little scheduling knowledge to jump into creating and uploading test jobs and learn on the fly.

Disclaimer: When in doubt read the manual. BMC provides very easy to read manuals (compared to other applications) they are full of details and

tidbits you just wont find anywhere else. I would have to say Control-M is very user intuitive and you can use the manuals as a great reference for any

issues that arise.

What is covered?

How Control-M works

Parts of Control-M

How to create a job

How to upload a table

How Control-M works:

A basic overview of Control-M requires you to only know 3 parts. The Control-M Data Center, The Agent, and Your server.

Basically the Data Center is the Servers that Control-M itself resides on. There are several parts to these servers but it is not necessary for you to know

this. Just understand the data center is where your jobs are contained.

The Agent is a Control-M component that resides on your server. (there is agent less ability in Control-M 7+) The agent gives you many of the features

Control-M offers and acts as a translator between the Data Center and your server.

Your Server is where all the actual processing is done. Your scripts reside there that Control-M will trigger and monitor, or it is where commands are

issue to from Control-M.

Aging this is a very basic understanding of the way control-M works. There are several Servers combined housing various parts of Control-M its

database and attached storage.

Parts of Control-M.

By parts I am referring to the interfaces you will use, GUI's or applications. Average users will use only two of these, Desktop and Enterprise Manager.

There are however other interfaces like Configuration manager, Reporting facility and BIM. For the purpose of this we will cover Desktop and Enterprise

Manager (EM).

Desktop

Desktop is used to create Tables and jobs. You will do all of you actual manipulation of the jobs in Desktop. If you were building a chair it would

be the workshop you would cut and assemble the pieces.

Enterprise Manager (EM)

EM is where you follow your job and manipulate it daily. It is where if a job was scheduled to run and you wanted to hold it you would do so. If

Control-M 7 Basics

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

14 of 25 12/1/2013 10:18 PM

Page 2: Learn While I Learn Control-M

be the workshop you would cut and assemble the pieces.

Enterprise Manager (EM)

EM is where you follow your job and manipulate it daily. It is where if a job was scheduled to run and you wanted to hold it you would do so. If

you wanted to see why the job hasn't run yet, Delete the job, rerun it etcetera you would do this all in EM. With our chair example this is the

house you would sit in it at.

How to create a job.

Now lets get to the best part creating the job. There are several Job types, we are going to cover the following types; Job Type OS : Command, Job &

Dummy. We will assume that most jobs are on a Linux platform but will also include a windows job as an example.

We will go Tab by Tab in the job creation starting from the General Tab. Also here is a test Draft(Draft to be linked soon) ,the one used in the examples

below. Right click on the link and do a Save Target as otherwise it will open as xml in your browser. Follow the steps below and\or use the sample as

well.

1. Open Control-M Desktop

Sign in using your Control-M ID and password.

Sign into the the test server.

2. Click on File | New| Local Workspace - This will open your work area.

3. (Shortcut Step) Click on Edit| New| Job - This is going to create a new job into a blank table. It is a shortcut step because you are not creating a table

first. The average group (in CompanyXYZ) does not use Smart tables so if you do refer to the manual. This will create a basic job and give you an error

stating that No Control-M has been defined. Just acknowledge the error.

4. Create your Job - The most important items to start out with are Control-M, Parent Table, Application, Group. These tend to remain the same

throughout all of your jobs and are the strictest when it comes to following standards.

Refer to the screenshot for our test Jobs information.

5. General Tab - General Job information

Job Name - Unique Identifier for the job - Follow job naming standards (Required for all Types)

Task Type - Allows you to select the type of task (job) it is - Job, Command, Dummy, Detached (Required for all Types)

File Name - This would be the file you are referencing on the server. (Required for Job & Detached only)

File Path - If you have a file name you need a path. (Required for Job & Detached only)

Over Lib - Override library this is mostly used for mainframe jobs. Refer to manual for other uses.

Command - If your running a command job you need a command. This is where it would go. (Required for Command only)

Hierarchy - This includes the Parent Table, Application and Group that should be standard for all jobs in a group.

Owner - This is a very important field. It is the ID that the command or Job you are running requires on the server. Without this your jobs will not

run (Required for all Types)

Author - This is the person who created or last updated the job. (Required for all Types)

Documentation - The URL of where your documentation (Call out procedure\ Run book) is stored. In CompanyXYZ Control-M is monitored

24/7/365 if your job fails someone will see it and check this location for call out requirements. (Required by CompanyXYZ for all Types)

Description - Details on what the job does. This helps the team (yours and ours) to know what the purpose of this job is. (Required

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

15 of 25 12/1/2013 10:18 PM

Page 3: Learn While I Learn Control-M

Author - This is the person who created or last updated the job. (Required for all Types)

Documentation - The URL of where your documentation (Call out procedure\ Run book) is stored. In CompanyXYZ Control-M is monitored

24/7/365 if your job fails someone will see it and check this location for call out requirements. (Required by CompanyXYZ for all Types)

Description - Details on what the job does. This helps the team (yours and ours) to know what the purpose of this job is. (Required

by CompanyXYZ for all Types

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

16 of 25 12/1/2013 10:18 PM

Page 4: Learn While I Learn Control-M

6. Scheduling Tab - Define when the job should run

You can also use a calendar see Using predefined calendars to schedule jobs Chapter 8 in the Control-M User Guide for information on this. (I

will not cover it here)

This section will allow you to pick the days and times a job is allowed or wanted to run. In Control-M job only come in when they are scheduled or

demanded to run by another job. Here you will define when they can run as long as all other requirements on the job are satisfied. We will cover only the

following field here:

Month Days

Week Days

Months

Month Days - These are the actual days you want the job to run. Highlight every day the job will run. If you want it to run with additional

restrictions for example you want the job to run 5 days before the last day of the month you will use the Rules Box in the Days: section.

Week Days - These are set up exactly the same as Month days except use the Days of the week. Using the And\Or option between the two

fields will allow you to select if you want it to run on the 5 only if its a Wednesday or always on Wednesday's. There is also a Rules box for

specific Day of the week rules you may need. Example: Need a job to run the First Tuesday of the month.

Moths - Like above can be used in combination with Days and Weeks information or on its own. Example - Allow jobs to run All months or on

January March and April.

Image below - Show's jobs running on the 1,7,9,13,17,19,25,29 all months and ignores the Week Days.

Image below - Shows the schedule as 8 days from the last day of the month and any Sunday or Saturday, but only in the months Jan, Mar,

Jun, Aug, Oct and Dec. So this job would run only once if the 8th day from the last day was a Sunday or a Saturday but if it was not it would

also run regardless of the day.

Note: For any calendar information see the Manual. Smart Tables also operate differently. Please refer to the manual.

7. Execution Tab - Define where and how the job should run on dates scheduled

(More to come).......

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

17 of 25 12/1/2013 10:18 PM

Page 5: Learn While I Learn Control-M

(More to come).......

Posted 14th October 2012 by Joshua Houzvicka

Labels: BMC Computers Control-M ControlM Help Scheduling

0 Add a comment

Control-M Job Handshakes

Question was:

In the below scenario, 001 and 002 are the main programs. 007 is just a log checker.

The layout might be better displayed like this:

001 -> 007

|

V

002

So 001 would run, no matter what 007 would also run, whether 001 passed or failed.

002 should only run if 001 passed AND 007 finished.

But instead 002 is starting even tho 001 is failed.

Solution:

Control-M Job Handshakes

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

18 of 25 12/1/2013 10:18 PM

Page 6: Learn While I Learn Control-M

��������������� ���� ������������������������������

�������������� ���� ���������������������

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

19 of 25 12/1/2013 10:18 PM

Page 7: Learn While I Learn Control-M

����������� �� ����������������� ���� ��

������� ��������

������������ ������������ �������� ��!��������������"���� ���#���������������! ����������������������$��!��%

&'������������������������ ���� ���$�������� ����(

����������� �������)����� ���� �����������&�*(�������

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

20 of 25 12/1/2013 10:18 PM

Page 8: Learn While I Learn Control-M

����������� �������)����� ���� �����������&�*(�������

+�����,-(

Posted 12th October 2012 by Joshua Houzvicka

Labels: BMC Computers Control-M ControlM Help Scheduling

0 Add a comment

Deftable

Script that allows the import of an xml file into control-m. equivalent of a write if you were using a draft file in 6.3

The script name is defimport.sh

#!/bin/sh

TABLE=$1

if [ $# -lt 1 ]

then

echo

echo "Usage: $0 <Controlm Table Name - dot xml>"

echo

echo "e.g. /dun/XYZ123/controlm/em613/defimport.sh AP.xml"

echo

exit 1

fi

SET_VARIABLES()

{

USER=emuser

PWD=XXXXXXX

SRVR=XYZ123.company.com

}

EXECUTE_COMMAND()

{

deftable -u $USER -p $PWD -s $SRVR -src $TABLE /o

}

##

## MAIN SECTION

SET_VARIABLES

EXECUTE_COMMAND

exit

#!/bin/sh - This statement identifies the script as a SH(Bourne SHell) type

TABLE=$1 - This is saying that when the job is run anything in spot 1 is a variable to be used in the job.

Example: To run the job you would used command (in CM) defimport AP.xml

AP.xml is the variable that will be used in the job in place of $TABLE

if [ $# -lt 1 ] - This states that IF there is any variables after the command "$#" there can not be "-" less than "lt" one "1"

Deftable

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

21 of 25 12/1/2013 10:18 PM

Page 9: Learn While I Learn Control-M

AP.xml is the variable that will be used in the job in place of $TABLE

if [ $# -lt 1 ] - This states that IF there is any variables after the command "$#" there can not be "-" less than "lt" one "1"

variable

then - If the above statement is not ment it will show the information below.

echo

echo "Usage: $0 <Controlm Table Name - dot xml>"

echo

echo "e.g. /dun/XYZ123/controlm/em613/defimport.sh

AP.xml"

echo

- This is the information shouted to the sysout if there is something wrong with the format of the job. echo'ed to the screen of the user (via the sysout)

fi - this is closure of the if statement.

SET_VARIABLES() - Statement saying that there are going to be variable that need to be set within the script

{

USER=emuser

PWD=XXXXXXX

SRVR=XYZ123.company.co

m

}

- The variable within the job that will need to be set. Example if $USER appears in the script the job will replace that variable with emuser { must contain

the variables.}

EXECUTE_COMMAND() - Tells the system that it is going to be executing a command

{

deftable -u $USER -p $PWD -s $SRVR -src $TABLE /o

}

- The command that the script is running. like the variable must be { contained }. This is most likely where variable will be used and the command must

follow the format of the command as if you were running it on the system without a script. Like in the example -u indicates username for the command.

All we did was use the $USER variable so it will use a specific ID.

## - Comments marker

## MAIN SECTION - this was commented out. Believe just leftover from a previous script

SET_VARIABLES - Telling the job what it needs to do before it can go on

EXECUTE_COMMAND - Its next step

exit - Exit completed since there is not a 1 or another code it exits with 0. 0 normally indicates a successful run

That's it.

If I have something wrong feel free to correct it. I am not a scripter by any definition. I make things do what i have to make them do by trial, error and

Google.

Posted 12th October 2012 by Joshua Houzvicka

Labels: BMC Control-M ControlM Help Scheduling Scripting

0 Add a comment

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

22 of 25 12/1/2013 10:18 PM

Page 10: Learn While I Learn Control-M

0 Add a comment

How the Control-M 6.3 to 7.x Draft Convert Process works

(Back end)

This information is provided so there is complete knowledge transfer of how this is accomplished. It is

provided so in the future it is needed for another convert the info to do it is available. It was not available

to me besides in manuals and google. Enjoy...

The reason this was needed is so that draft files from Control-M 6.3 could be converted into xml so

control-m 7 could open them and they could be manipulated. Draft files from 6.3 CANNOT be opened in

7.0 in all cases. This removes that obstacle. (Also stops the need for a migration, system is already in

use by other teams)

First thing that had to be done was a XML file needed to be created called export7.xml

This file contains the TERMS that Control-M looks for when running the export function

export7.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE TERMS SYSTEM "terms.dtd">

<TERMS>

<TERM>

<PARAM NAME="DATACENTER" OP="EQ" VALUE="TEST-QA"/>

<PARAM NAME="TABLE_NAME" OP="EQ" VALUE="convert7"/>

</TERM>

</TERMS>

What this means line by line:

<?xml version="1.0" encoding="UTF-8"?> This states that the file is XML and the encoding type

<!DOCTYPE TERMS SYSTEM "terms.dtd"> This tells the file to look for the terms.dtd file control-m uses

to define fields

<TERMS> xml code saying start terms needed in xml formatting

<TERM> xml code saying start term needed in xml formatting

<PARAM NAME="DATACENTER" OP="EQ" VALUE="TEST-QA"/> says look in TEST-QA Data center

<PARAM NAME="TABLE_NAME" OP="EQ" VALUE="convert7"/> says look for table names convert7

</TERM> xml code saying start end terms needed in xml formatting

</TERMS>xml code saying start end term needed in xml formatting

Once this file is created it needs to be placed on XYZ12 in this case we placed it in /dun/XYZ12/controlm

/em613

Now we created a control-m job for the convert. using the following details

CONTROL-M TEST-QA

Job Type: OS

Job Name: ExportDefTable

Task Type: Command

File Name: exportdeftable Just for reference not needed

Path: /dun/XYZ12/controlm/em613

Command: exportdeftable -u %%USER1 -p %%PASS1 -s %%GUISERV -arg export7.xml -out

%%PATH1

How the Control-M 6.3 to 7.x Draft ConvertProcess works (Back end)

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

23 of 25 12/1/2013 10:18 PM

Page 11: Learn While I Learn Control-M

File Name: exportdeftable Just for reference not needed

Path: /dun/XYZ12/controlm/em613

Command: exportdeftable -u %%USER1 -p %%PASS1 -s %%GUISERV -arg export7.xml -out

%%PATH1

Owner: emuser

Description: Export Table in XML to Control-M DIR

Table| Application| and Group can be anything you will identify with

We made the job only come in on demand so it has no schedule and has a Confirm needed.

Has an Out condition of ExportDefTable_OK + so we can trigger the FTP job

And we use the following Variable in the set tab

Var Name Value

PATH1 /dun/XYZ12/controlm/em613/7ready.xml

GUISERV XYZ12.company.com

USER1 emuser

PASS1 password

We did add a shout if this job fails but there is no need. the process we have you will be watching the job

as it runs.

Identifying the command:

exportdeftable - this is the export table command

-u %%USER1 - this is the username needed on the server

-p %%PASS1 - this is the password needed on the server

-s %%GUISERV - this is the server needed on the server

-arg export7.xml - this is the file name with the TERMS needed to compare to

-out %%PATH1 - this is the Patch and file name for the converted file

FTPing the file to a pc

There are a couple ways to do this. You could do it manually using Reflections but I decided to make a

job to do it.

First I installed FileZIlla FTP server on PC 4. Then created a FTP file (in 6.3 AFT is not installed) to use

Linux to FTP the file to PC 4. Called the file 7ReadyFTP.sh

7ReadyFTP.sh

#!/bin/bash

HOST=PC4.enterprise.org #This is the FTP servers host or IP address.

USER=ccsops #This is the FTP user that has access to the server.

PASS=ccsops #This is the password for the FTP user.

# Call 1. Uses the ftp command with the -inv switches. -i turns off interactive prompting. -n Restrains FTP

from attempting the auto-login feature. -v enables verbose and progress.

ftp -inv $HOST << EOF

# Call 2. Here the login credentials are supplied by calling the variables.

user $USER $PASS

# Call 3. Here you will change to the directory where you want to put or get

cd /dun/XYZ12/controlm/em613

# Call4. Here you will tell FTP to put or get the file.

put 7ready.xml

# or

#get test.txt

bye

EOF

This file is pretty descriptive of what is done so I'm not going to add anything else.

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

24 of 25 12/1/2013 10:18 PM

Page 12: Learn While I Learn Control-M

bye

EOF

This file is pretty descriptive of what is done so I'm not going to add anything else.

Then I created a simple Control-M job to run this script. using the following details

CONTROL-M TEST-QA

Job Type: OS

Job Name: FTP_7readyxml

Task Type: Job

File Name: 7ReadyFTP.sh

Path: /dun/XYZ12/controlm/em613

Owner: emuser

Description: FTP 7ready.xml to PC4

Table| Application| and Group can be anything you will identify with

We made the job only come in on demand so it has no schedule and has a In condition of of

ExportDefTable_OK + and an out condition of ExportDefTable_OK - to reset the condition in case multiple

runs are used in the same day

We did add a shout if this job fails but there is no need. the process we have you will be watching the job

as it runs.

The default home directory for the FTP is the desktop but could be set to anything you would like.

Posted 12th October 2012 by Joshua Houzvicka

Labels: BMC Computers Control-M ControlM Help Scheduling Scripting

0 Add a comment

Control-M 6.3 to 7.x Draft Convert Process

Note: "This process was created when we had to convert from version 6.3 to 7.0. We wanted some

manual manipulation of the xml file before we uploaded it into the new version. since you cannot just

open a draft from one version to the other without exporting it into the xml format."

This is to be used for any draft a team sends to us. It is important to complete each step before doing another. If

this is not completed you may overwrite previously written data.

What is assumed:

You know how to use Control-MThe Filezilla FTP server is running on a local PC (PC4 in this example)

You have access to PC4

1. Download the draft or save attachment from the email

2. Open the draft file in Desktop for 6.3 (for the example I am using FACTORY.drft)

Control-M 6.3 to 7.x Draft Convert Process

Learn While I Learn Control-M http://learningcontrolm.blogspot.in/?view=classic

25 of 25 12/1/2013 10:18 PM