emdef Utility for Services

The emdef is a command line utility used to make various modifications to service definitions in the Control-M/EM database.

The emdef utility includes the following utilities:

Utility

Description

defservice

Imports service processing definitions into the Control-M/EM database

exportdefservice

Exports service definitions

defservice

The defservice utility imports service processing definitions into existing folders in the Control-M/EM database. To import service processing definitions using the defservice utility, see Running the defservice Utility.

defservice reads service processing definitions from a plain text input file written in XML format.

The defservice input file is checked and processed. If there are any errors in the file, a message is displayed specifying the lines with the errors.

Running the defservice Utility

This procedure describes how to import SLA Management service processing definitions into existing folders in the Control-M/EM database using the defservice utility.

Begin

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

  2. Enter either of the following commands:

    • emdef defservice [-u <user> [-p <password>] | -pf <password file>] -s <GUI Server Name> -src <xml File Name> [/a]
    • emdef defservice [-USERNAME <user> [-PASSWORD <password>] | -PASSWORD_FILE <password file>] -HOST <GUI Server Name> -SRC_FILE <xml File Name> [/a]

defservice XML Input File Example

The following example input file is used with the defservice utility:

Copy
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE DEFSERVICE SYSTEM "defservice.dtd">
<DEFSERVICE >
<SERVICE CREATED_BY="emuser" CREATE_TIME="20100819224237UTC" INSTANTIATION_TYPE="Filter" LAST_UPDATE_TIME="20100822055018UTC" NAME="example" ORDERABLE="0" SERVICE_ID="8">
<FILTER >
<INCLUDING_TERMS >
<TERM >
<PARAM NAME="CONTROL-M Name" OP="NEQ" VALUE="isvm-w23-ctmDS9"/>
 </TERM>
</INCLUDING_TERMS>
</FILTER>
</SERVICE>
<SERVICE CREATED_BY="emuser" CREATE_TIME="20100818093723UTC" INSTANTIATION_TYPE="Filter" LAST_UPDATE_TIME="20100822055952UTC" NAME="filter service" ORDERABLE="0" SERVICE_ID="1">
<FILTER >
<INCLUDING_TERMS >
<TERM >
<PARAM NAME="CONTROL-M Name" OP="LIKE" VALUE="isvm-w23-ctmDS9"/>
<PARAM NAME="ORDER_FOLDER" OP="LIKE" VALUE="TestCon, TestCon2"/>
</TERM>
</INCLUDING_TERMS>
 </FILTER>
 </SERVICE>
<SERVICE CREATED_BY="emuser" CREATE_TIME="20100818093756UTC" INSTANTIATION_TYPE="FilterODAT" LAST_UPDATE_TIME="20100822055018UTC" NAME="odat service" ORDERABLE="0" SERVICE_ID="2">
<FILTER >
<INCLUDING_TERMS >
 <TERM >
<PARAM NAME="CONTROL-M Name" OP="LIKE" VALUE="isvm-w23-ctmDS9"/>
 <PARAM NAME="ORDER_FOLDER" OP="LIKE" VALUE="TestCon, TestCon2"/>
</TERM>
 </INCLUDING_TERMS>
</FILTER>
</SERVICE>
<SERVICE CREATED_BY="emuser" CREATE_TIME="20100818094142UTC" INSTANTIATION_TYPE="Job" LAST_UPDATE_TIME="20100822055018UTC" NAME="order (job) service" ORDERABLE="1" SERVICE_ID="4">
 <FILTER >
<INCLUDING_TERMS >
<TERM >
 <PARAM NAME="CONTROL-M Name" OP="EQ" VALUE="isvm-w23-ctmDS9"/>
<PARAM NAME="ORDER_FOLDER" OP="EQ" VALUE="TestCon_"/>
<PARAM NAME="JOBNAME" OP="EQ" />
</TERM>
</INCLUDING_TERMS>
 </FILTER>
<ORDERABLE_PARAM DISPLAY_NAME="p1" PARAM_NAME="p1" PARAM_TYPE="String" REQUIRED="1" VALIDATION=","/>
</SERVICE>
<SERVICE CREATED_BY="emuser" CREATE_TIME="20100819211228UTC" INSTANTIATION_TYPE="SMARTFolder" LAST_UPDATE_TIME="20100822055018UTC" NAME="tzahi" ORDERABLE="1" SERVICE_ID="6">
<FILTER >
<INCLUDING_TERMS >
<TERM >
<PARAM NAME="CONTROL-M Name" OP="EQ" VALUE="isvm-w23-ctmDS9"/>
<PARAM NAME="ORDER_FOLDER" OP="EQ" VALUE="aaa22"/>
</TERM>
</INCLUDING_TERMS>
</FILTER>
</SERVICE>
<SERVICE CREATED_BY="emuser" CREATE_TIME="20100822045059UTC" INSTANTIATION_TYPE="Filter" LAST_UPDATE_TIME="20100822055018UTC" NAME="tzahi10" ORDERABLE="0" SERVICE_ID="10">
<FILTER >
<INCLUDING_TERMS >
<TERM >
<PARAM NAME="CONTROL-M Name" OP="LIKE" VALUE="isvm-w23-ctmDS9"/>
<PARAM NAME="APPLICATION" OP="LIKE" VALUE="DailyAppl"/>
<PARAM NAME="GROUP" OP="LIKE" VALUE="DailyJobs"/>
<PARAM NAME="ORDER_FOLDER" OP="LIKE" VALUE="Con2Folder"/>
<PARAM NAME="ORDER_LIB" OP="LIKE" VALUE="folder"/>
<PARAM NAME="MEMLIB" OP="LIKE" VALUE="memlib"/>
<PARAM NAME="MEMNAME" OP="LIKE" VALUE="memname"/>
<PARAM NAME="JOBNAME" OP="LIKE" VALUE="jobname"/>
<PARAM NAME="TASKTYPE" OP="LIKE" VALUE="*Job*, *Task*, Command, Detached, Dummy, External"/>
<PARAM NAME="OWNER" OP="LIKE" VALUE="owner"/>
<PARAM NAME="DEF_HOSTGROUP" OP="LIKE" VALUE="hostgroup"/>
<PARAM NAME="APPL_TYPE" OP="LIKE" VALUE="OS"/>
</TERM>
</INCLUDING_TERMS>
</FILTER>
</SERVICE>
<SERVICE CREATED_BY="emuser" CREATE_TIME="20100819223946UTC" INSTANTIATION_TYPE="Job" LAST_UPDATE_TIME="20100822055018UTC" NAME="tzahi2" ORDERABLE="1" SERVICE_ID="7">
<FILTER >
<INCLUDING_TERMS >
<TERM >
<PARAM NAME="CONTROL-M Name" OP="EQ" VALUE="isvm-w23-ctmDS9"/>
<PARAM NAME="ORDER_FOLDER" OP="EQ" VALUE="DailySchedule"/>
<PARAM NAME="JOBNAME" OP="EQ" VALUE="SuadCommand0"/>
</TERM>
</INCLUDING_TERMS>
</FILTER>
<ORDERABLE_PARAM DISPLAY_NAME="param" PARAM_NAME="My Param" PARAM_TYPE="String" REQUIRED="0" VALIDATION=","/>
</SERVICE>
<SERVICE CREATED_BY="emuser" CREATE_TIME="20100821140755UTC" INSTANTIATION_TYPE="Filter" LAST_UPDATE_TIME="20100822055018UTC" NAME="tzahi3" ORDERABLE="0" SERVICE_ID="9">
<FILTER >
 <INCLUDING_TERMS >
<TERM >
<PARAM NAME="CONTROL-M Name" OP="LIKE" VALUE="isvm-w23-ctmDS9, THID0106"/>
<PARAM NAME="APPLICATION" OP="LIKE" VALUE="SuadDailyAppl*"/>
<PARAM NAME="GROUP" OP="LIKE" VALUE="DailyJobs, TestCon*"/>
<PARAM NAME="MEMLIB" OP="LIKE" VALUE="memlib"/>
<PARAM NAME="TASKTYPE" OP="LIKE" VALUE="*Job*, Command"/>
<PARAM NAME="DEF_HOSTGROUP" OP="LIKE" VALUE="hostgroup"/>
</TERM>
</INCLUDING_TERMS>
</FILTER>
</SERVICE>
<SERVICE CREATED_BY="emuser" CREATE_TIME="20100822060917UTC" INSTANTIATION_TYPE="Filter" LAST_UPDATE_TIME="20100822060917UTC" NAME="ServiceFilter" ORDERABLE="0" SERVICE_ID="11">
<FILTER >
<INCLUDING_TERMS >
<TERM >
<PARAM NAME="CONTROL-M Name" OP="LIKE" VALUE="controlm"/>
<PARAM NAME="APPLICATION" OP="LIKE" VALUE="application"/>
<PARAM NAME="GROUP" OP="LIKE" VALUE="group"/>
<PARAM NAME="ORDER_FOLDER" OP="LIKE" VALUE="folder"/>
 <PARAM NAME="ORDER_LIB" OP="LIKE" VALUE="folderlin"/>
<PARAM NAME="MEMLIB" OP="LIKE" VALUE="memlib"/>
<PARAM NAME="MEMNAME" OP="LIKE" VALUE="memname"/>
<PARAM NAME="JOBNAME" OP="LIKE" VALUE="jobname"/>
<PARAM NAME="TASKTYPE" OP="LIKE" VALUE="*Job*, *Task*, Command, Detached, Dummy, External"/>
<PARAM NAME="OWNER" OP="LIKE" VALUE="owner"/>
<PARAM NAME="DEF_HOSTGROUP" OP="LIKE" VALUE="hostgroup"/>
<PARAM NAME="APPL_TYPE" OP="LIKE" VALUE="OS"/>
<PARAM NAME="DESCRIPTION" OP="LIKE" VALUE="description"/>
</TERM>
</INCLUDING_TERMS>
</FILTER>
</SERVICE>
</DEFSERVICE>

exportdefservice

The exportdefservice parameter of the emdef utility exports SLA Management service processing definitions from the Control-M/EM database to an output file. To export service processing definitions using the utility, see Running the exportdefservice Utility.

When exportdefservice is invoked, it processes a specified file of arguments in XML format. For more information, see exportdefservice Arguments File. This file contains statements that identify existing service processing definitions. The identified definitions are exported from the Control-M/EM database to an output file. You can modify the exported service processing definitions in the output file and can import the modified definitions into the Control-M/EM database using the defservice utility.

Running the exportdefservice Utility

This procedure describes how to export SLA Management service processing definitions from the Control-M/EM database to an output file, using the exportdefservice utility.

Begin

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

  2. Enter one of the following commands:

    • emdef exportdefservice [-u <user> [-p <password>] | -pf <password File>] -s <GUI Server Name> -arg <args file name> -out <file name>
    • emdef exportdefservice [-USERNAME <user> [-PASSWORD <password>] | -PASSWORD_FILE <password file>] -HOST <GUI Server Name> -ARG_FILE <args file name> -OUT_FILE <file name>

      For Windows you do not need to use the emdef prefix.

    For details about the exportdefservice parameters and options, see exportdefservice Parameters and emdef Switches.

exportdefservice Parameters

The following table lists the exportdefservice 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 name>

Defines a flat file containing an unencrypted user name and password on separate lines in the format:

user=<userName >
password=<password>

<GUI Server name>

Defines a Control-M/EM GUI server logical name, host name, or IP address.

If multiple GUI servers exist, set this parameter to the logical name of the relevant GUI server.

<Args file name>

Defines the path and name of the arguments file containing exportdefservice specifications. For information about this file, see XML File Rules.

<file name>

Defines the path and name of the file containing the exported service specifications.

-ctm

Defines the name of the Control-M installation that processes the job.

-folder

Defines the name of folder.

app

Defines the name of the Application to which the job's group belongs

-subapp

Defines the name of the Sub Application to which the job belongs.

-service

Defines the name of the service for export.

/?

Displays utility's description and available options.

/a

Accept all. Instructs the utility to automatically reset the Created By parameter to the current Control-M/EM user when these two values do not match. If not specified, the utility skips (that is, does not process) job definitions whose Author does not match the currently logged in user.

The /a switch has no effect on Administrator users and is relevant only when the AuthorSecurity system parameter is set to 2 or 3.

exportdefservice Arguments File

The following rules apply to the exportdefservice argument file:

  • More than one service can be specified in an exportdefservice file.

  • The arguments file is case-sensitive.

  • All parameter values must be enclosed in quotation marks.

  • More than one PARAM parameter can be used in a TERM statement.

  • The relationship between PARAM parameters in a TERM statement is AND.

For instructions about preparing this file, seeXML File Rules.

The exportdefservice arguments file is checked and processed. If there are any errors, a message is displayed specifying the lines with the errors. The exported service processing definitions are saved to the output file whose name and location is specified in the -out <out file name>parameter.

exportdefservice Arguments File Parameters

The following table describes the exportdefservice arguments file parameters:

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.

Parameter

Description

TERMS

Indicate the start and end of the TERMS file. Only criteria that are located between the tags are considered to be part of the argument.

TERM

Indicate the start and the end of a group of selection criteria used to specify a service or services that are to be exported. Only PARAM tags that are located between the TERM tags are considered to be part of the TERM argument.

REL: Relationship between terms.

Valid values:

  • AND

  • OR

PARAM

Selection criteria parameter used to determine the service definitions that are to be exported. More than one PARAM can be specified. Mandatory.

PARAM NAME="DATACENTER" OP="E" VALUE="Center1"

  • NAME: The parameter name of any service processing definition parameter.

  • OP: Relationship between the NAME and VALUE parameters of the TERM. Mandatory.

    Valid values:

    • EQ: equal

    • NEQ: not equal

    • LIKE: mask or pattern

  • VALUE: String. Mandatory. Value of the parameter specified in the NAME field.

exportdefservice Arguments File Example

The following example arguments file is used with the exportdefservice utility:

Copy
<TERMS>
<TERM>
<PARAM NAME="NAME" OP="LIKE" VALUE="*"/>
</TERM>
</TERMS>