loopdetecttool
This utility has been deprecated. It is no longer enhanced and support will be discontinued in version 9.0.22. For more information, see emdef Utility Suite Deprecation.
The loopdetecttool utility checks job processing definitions to determine if conditions are defined in a way that would cause loops. A loop in this context means:
-
A chain of jobs never run because the In condition needed to start the first job in the chain is only created by the last job in the chain.
-
Any combination of jobs, groups, and conditions between them, because it is not clear which job in the group runs first or last, creating or deleting the relevant conditions.
To check for loops in a number of jobs, see Detecting Loops in Jobs Using the loopdetecttool Utility.
The loopdetecttool parameter of the emdef utility reads an argument file (in XML format) that contains criteria that determine which job processing definitions and SMART folder the utility should analyze. For more information, see loopdetecttool Arguments File Rules. The utility checks for definitions whose conditions could potentially cause a loop. After the utility runs, it summarizes the problematic jobs and conditions in an XML format file.
For an example of the two validation processes see emdef Validation Service Error Message Example.
Detecting Loops in Jobs Using the loopdetecttool Utility
The following procedure describes how to check job processing definitions to determine if conditions are defined in a way that would cause loops using the loopdetecttool utility,
Begin
-
Do one of the following:
-
UNIX: Log in to a Control-M/EM account.
-
Windows: Open a command prompt window where Control-M/EM is installed. You do not need to be in the Control-M/EM database directory.
For Windows client installations, open a command prompt window and navigate to the <EM Instance Name>\bin directory.
-
-
Type the following:
emdef loopdetecttool [-U <user> [-P <password>] | -pf <password file>] -s <GUI Server Name> -arg <input args file name> -out <output result file name> [-vv 2]
For Windows, you do not need to use the emdef prefix.
loopdetecttool Parameters
The following table describes the loopdetecttool parameters:
Parameter |
Description |
---|---|
<user> |
Defines the Control-M/EM database owner user name. |
<password> |
Defines the Control-M/EM database owner user password. |
<password file> |
Describes a flat file that contains an unencrypted user name and password on separate lines in the following format: user=<userName> password=<password> |
<GUI Server Name> |
Defines the logical name for the Control-M/EM GUI server. |
<input args file name> |
Describes the path and name of the arguments file that contains criteria for job and SMART folder specifications. The format for this file is described in loopdetecttool Arguments File Rules. For information about this file, see the Arguments file rules section below and XML File Rules. |
<output result file name> |
Describes the path and name of the output file that contains the summary of problematic jobs and conditions (loops). |
loopdetecttool Arguments File Rules
The arguments file is processed. Corresponding definitions in the Control-M/EM database are checked. A summary that lists problematic definitions and conditions (loops) is produced in the output file whose name and location is specified in the out file name parameter.
The following rules apply to the loopdetecttool argument file:
-
The arguments file is case-sensitive.
-
More than one PARAM parameter can be used in a TERM statement.
-
The relationship between PARAM parameters in a TERM statement is AND.
-
The default relationship between TERM statements is OR.
-
All parameter values must be enclosed in quotation marks (for example, JOBNAME="Job1").
The output file is in XML format and is structured as follows:
-
All loops are listed between ctmem:loops tags.
-
For each loop found, problematic jobs and conditions are listed.
loopdetecttool Arguments File Parameters
The following table describes arguments file parameters for the loopdetecttool utility:
The first two lines of the arguments file specify the XML version, the text encoding format being used, and the location of the .dtd file. These lines must appear exactly as follows:
?xml version=’1.0’ encoding=’UTF-8’?
!DOCTYPE TERMS SYSTEM "terms.dtd"
Parameter |
Description |
---|---|
TERMS |
Indicates the start and end of the TERMS file. Only criteria that are located between the tags are considered part of the argument. |
TERM |
Indicates the start and the end of a group of selection criteria used to specify a job or jobs that are to be analyzed. Only PARAM tags that are located between the TERM tags are considered part of the TERM argument. REL: The relationship between the terms (optional). Valid values:
|
PARAM |
Defines the selection criteria parameter used to determine the job definitions that are to be analyzed. You can specify more than one PARAM. This parameter is required. PARAM NAME="DATACENTER" OP="EQ" VALUE="Center1"
|
loopdetecttool Output
The following table lists the problematic jobs and conditions in an XML format file after the utility runs.
The beginning of the arguments file specifies the location of the .dtd file as follows:
!DOCTYPE "ctmem:loop_cond_detect" SYSTEM "path\filename.dtd"
Parameter |
Description |
---|---|
ctmem:message |
Lists relevant messages such as the number of loops detected, how many jobs were found in each loop, and other remarks. |
ctmem:loops |
Provides details about all loops that are found. |
ctmem:loop |
Provides details about each loop that is found. Each ctmem:loop tag contains pairs of the following tags: ctmem:job and ctmem:condition. |
ctmem:job |
Provides information about the job that is part of a potential loop. This information includes the job’s data center, SMART folder, group, application, and job name. Pairs of jobs and conditions are grouped by In and Out conditions. |
ctmem:condition |
Provides information about the conditions that were found to cause a potential loop. This information includes the condition’s name, date, and type. Pairs of jobs and conditions are grouped by In and Out conditions. |
loopdetecttool Output Example
<!DOCTYPE ctmem:loop_cond_detect SYSTEM "C:\Program Files\Altova\XML Spy Suite\Examples\LoopDetectOut.dtd">
<ctmem:loop_cond_detect>
<ctmem:message>1 Loop was detected.</ctmem:message>
<ctmem:loops>
<ctmem:message>2 Jobs were found in the loop</ctmem:message>
<ctmem:loop>
<ctmem:job>
<ctmem:control_m>PROD_DC1</ctmem:control_m>
<ctmem:order_folder>Daily_Prod1</ctmem:order_folder>
<ctmem:application>WinDcProd1</ctmem:application>
<ctmem:group>BackupDaily</ctmem:group>
<ctmem:job_name>Job1</ctmem:job_name>
</ctmem:job>
<ctmem:condition>
<ctmem:cond_name>Job1-Ended-OK</ctmem:cond_name>
<ctmem:cond_date>ODAT</ctmem:cond_date>
<ctmem:message>regular condition</ctmem:message>
</ctmem:condition>
<ctmem:job>
<ctmem:control_m>PROD_DC1</ctmem:control_m>
<ctmem:order_folder>Daily_Prod1</ctmem:order_folder>
<ctmem:application>WinDcProd1</ctmem:application>
<ctmem:group>BackupDaily</ctmem:group>
<ctmem:job_name>Job2</ctmem:job_name>
</ctmem:job>
<ctmem:condition>
<ctmem:cond_name>Job2-Ended-OK</ctmem:cond_name>
<ctmem:cond_date>ODAT</ctmem:cond_date>
<ctmem:message>regular condition</ctmem:message>
</ctmem:condition>
</ctmem:loop>
</ctmem:loops>
</ctmem:loop_cond_detect>
Analyze Job Definitions for Loops Based on One or More Criteria XML File Example
In the loopdetecttool XML file, analyzes job processing definitions that either the data center name is Data1, and a job name begins with the letter J or the job name is Job5, and the job is not cyclic.
<?xml version=’1.0’ encoding=’UTF-8’?>
<!DOCTYPE TERMS SYSTEM "terms.dtd">
<TERMS>
<TERM>
<PARAM NAME="DATACENTER" OP="EQ" VALUE="Data1"/>
<PARAM NAME="JOBNAME" OP="LIKE" VALUE="J*"/>
</TERM>
<TERM>
<PARAM NAME="JOBNAME" OP="EQ" VALUE="Job5"/>
<PARAM NAME="CYCLIC" OP="EQ" VALUE="0"/>
</TERM>
</TERMS>
Analyze Job Definitions for Loops Based on Multiple Criteria XML File Example
In the loopdetecttool XML file analyze all job processing definitions from either Data1 or Data2 data center that has a job name that does not begin with the letter R.
<?xml version=’1.0’ encoding=’UTF-8’?>
<!DOCTYPE TERMS SYSTEM "terms.dtd">
<TERMS>
<TERM>
<PARAM NAME="DATACENTER" OP="EQ" VALUE="Data1"/>
<PARAM NAME="JOBNAME" OP="NEQ" VALUE="R*"/>
</TERM>
<TERM>
<PARAM NAME="DATACENTER" OP="EQ" VALUE="Data2"/>
<PARAM NAME="JOBNAME" OP="NEQ" VALUE="R*"/>
</TERM>
</TERMS>