Agent Configuration

The following API commands enable you to configure an Agent:

config server:agent::update

The config server:agent::update command enables you to update one of the parameters in the configuration of the Control-M/Agent, as registered to the Server.

CLI Syntax

Copy
ctm config server:agent::update <server> <agent> <name> <value> [-f <json file>]

The following table describes the config server:agent::update command parameters.

Parameter

Description

server

Defines the name of the Server.

agent

Defines the hostname or alias of the Agent. This is the logical name of the Agent.

name

Defines the name of the parameter that you want to update.

For a list of parameters that you can update, see the next table.

value

Defines a new value for the parameter.

json file

(Optional) Defines the path to a JSON file that contains the parameter name and value.

You can use this JSON file instead of specifying the parameter name and value in the command line.

The following sample JSON content sets a new value for the maximumRetries parameter:

Copy
{
    "name": "maximumRetries",
    "value": "9"
}

 

The following table describes the Agent parameters that are supported by the config server:agent::update and config server:agent::test API commands.

Agent Parameter

Description

communicationTimeout

Determines the maximum number of seconds that Server attempts to connect to the Agent before the Agent is set to Unavailable.

Values: 30–65534

Default: 120

maximumRetries

Determines the number of times that the Server attempts to connect to the Agent before the Agent is set to Unavailable.

Value range: 1–100

persistentConnection

Determines whether to connect to a specific Agent with either a persistent or transient connection.

  • Y: Persistent connection.

  • N: Transient connection.

Default: N

sessionIdleTimeout

Determines the maximum number of seconds that a session can be idle before the Server terminates it.

Value range: 30–86400

Default: 900

maximumDisconnectTime

Determines the maximum number of seconds that the Server allows an Agent to be disconnected before it initiates a session.

Value range: 30–86400

Default: 300

serverToAgentPortNumber

Determines the port number that receives data from the Server to the Control-M/Agent.

Value range: 1025–65535

Default: 7006

unavailabilityShoutUrgency

Defines the urgency level of a message sent with high priority when an Agent has an Unavailable status.

Urgent messages are sent with a special indication so that the recipient of the message is aware of the urgency.

  • R: Regular

  • U: Urgent

  • V: Very urgent.

Default: R

allowAgentDisconnection

Determines if the current connection to this Agent can be disconnected when the maximum number of concurrent sessions is reached.

Allowing a persistent connection on an Agent to disconnect requires the connection to be reestablished before communication with the Agent can continue. If you run time-sensitive jobs on the Control-M/Agent, you might want to set this parameter to N.

  • Y: Allow disconnection.

  • N: Do not allow disconnection.

Default: Y

communicationProtocolVersion

Determines the version of the protocol for communication between Server and the Agent.

Valid Values: 12–14, where 14 is the most recent protocol version.

avalibleAgentCheckInterval

Determines the number of seconds between status checks for Agent communication with theServer.

If you decrease the default value, it might impact Server performance.

Value range: 30–65534

Default: 7,200 (2 hours)

unavalibleAgentRetryInterval

Determines the number of seconds between attempts to communicate with an Agent computer whose status is Unavailable.

If you decrease the default value, it might impact Server performance.

Value range: 30–65534

Default: 90

sslState

Determines whether the Secure Socket Layer (SSL) protocol is used to encrypt the communication between the Server and the Control-M/Agent:

  • Default: Default SSL state, as defined in the Server.

  • Enabled: SSL is enabled.

  • Disabled: SSL is disabled.

Default: Default

tag

Defines a logical name that is used to label specific Agents into a group with specific authorizations.

Valid Characters: A–Z, a–z, 0–9, ‘_’.

If annotation is enabled for the Configuration Management category in Control-M, you must also provide an annotation to justify your action. For more information, see Annotation Input.

REST API Syntax

cURL:

Copy
server=IN01
agent=myHost
name=maximumRetries
value=10

curl -H "x-api-key: $token" -H "Content-Type: application/json" -X POST 
-d "{\"name\":\"$name\", \"value\":\"$value\"}" "$endpoint/config/server/$server/agent/$agent/update"

config server:agent::delete

The config server:agent::delete command enables you to delete an Agent from the Server without shutting the Agent down.

CLI Syntax

Copy
ctm config server:agent::delete <server> <agent>

The following table describes the config server:agent::delete command parameters.

Parameter

Description

server

Name of Server.

agent

Host name or alias of the Agent. This is the logical name of the Agent.

If annotation is enabled for the Configuration Management category in Control-M, you must also provide an annotation to justify your action. For more information, see Annotation Input.

REST API Syntax

cURL:

Copy
server=controlm
agent=myhost
curl -H "x-api-key: $token" -X DELETE "$endpoint/config/server/$server/agent/$agent"

config server:agent::ping

The config server:agent::pingcommand enables you to check if the Agent is available.

CLI Syntax

Copy
ctm config server:agent::ping <server> <agent> [-f <configuration file>]

The following table describes the config server:agent::ping command parameters.

Parameter

Description

server

Name of Server.

agent

Name of Agent.

configuration file

(Optional) JSON file that contains additional parameters.

The following is a list of the additional parameters that can be used in the configuration file:

Copy
{
   "discover": true,
   "timeout":60
}

The following table describes additional config server:agent::ping command parameters.

Parameter

Description

discover

When true, the Agent is added to the Server when the ping status is unavailable.

Valid Values:

  • true

  • false

Default: false

timeout

Maximum time (in seconds) to wait for a ping response.

Default: 60

REST API Syntax

cURL:

Copy
server=IN01
agent=quickstart
curl -X POST -H "x-api-key: $token" -H "Content-Type: application/json" -d "{\"discover\": false, \"timeout\":60}" "$endpoint/config/server/$server/agent/$agent/ping"

config server:agents::get

The config server:agents::get command enables you to get a list of all Agents registered to the Server, along with basic details about each Agent. You can optionally filter the list for Agents that match a specific pattern.

CLI Syntax

Copy
ctm config server:agents::get <server> ["agent=<agent_pattern>"]

The following table describes the config server:agents::get command parameters.

Parameter

Description

server

Name of Server.

agent_pattern

(Optional) Filter the list to include only Agents that match a specified pattern. Use * for wildcards.

  • "Agent*"

  • "*Agent*"

REST API Syntax

cURL:

Copy
server=IN01
curl -H "x-api-key: $token" "$endpoint/config/server/$server/agents?agent=Agent*1*"

Response

For each agent, the following details are provided: node ID, status (Available, Unavailable, Disabled, or Discovering), a list of host groups to which the Agent is associated, product version, and host operating system. The following example shows the details returned for each agent:

Copy
{
  "agents": [
    {
      "nodeid": "myAgent",
      "status": "Available",
      "hostgroups": [
        "group1",
        "group2",
        "group3"
      ],
      "version": "9.0.21.080",
      "operatingSystem": "Microsoft Windows Server 2016  (Build 14393)"
    }
  ]
}

config server:agent::disable

The config server:agent::disable command enables you to disable the Agent from the Server. New jobs cannot run on the Agent.

CLI Syntax

Copy
ctm config server:agent::disable <server> <agent>

The following table describes the config server:agent::disable command parameters.

Parameter

Description

server

Name of Server.

agent

Name of Agent.

If annotation is enabled for the Configuration Management category in Control-M, you must also provide an annotation to justify your action. For more information, see Annotation Input.

REST API Syntax

cURL:

Copy
curl -X POST -H "x-api-key: $token" "$endpoint/config/server/$server/agent/$agent/disable"

config server:agent::enable

The config server:agent::enable command enables you to enable jobs to run on the Agent after it was disabled.

CLI Syntax

Copy
ctm config server:agent::enable <server> <agent>

The following table describes the config server:agent::enable command parameters.

Parameter

Description

server

Name of Server.

agent

Name of Agent.

REST API Syntax

cURL:

Copy
curl -X POST -H "x-api-key: $token" "$endpoint/config/server/$server/agent/$agent/enable"

config item::recycle

The config item::recycle command enables you to recycle a specific Control-M component. Use this command to restart a component to solve server issues. You can use this command to recycle Agents.

CLI Syntax

Copy
ctm config item::recycle <id>

The following table describes the config item::recycle command parameters.

Parameter

Description

id

The ID of the component that you want to recycle. This ID has the following syntax:

"<type>:<host>:<name>"

The ID is composed of the following elements:

  • type: The type of Control-M component. For recycling of an Agent, the type is CTMS:Agent.

  • host: The name of the machine that hosts the Control-M component. For an Agent, this is the name of the Server.

  • name: The logical name of the Control-M component. For an Agent, this is the host name or alias of the Agent.

REST API Syntax

cURL:

Copy
id="CTMS:Agent:IN01:myAgent"
curl -H "x-api-key: $token" -X POST "$endpoint/config/item/$id/recycle"

config server:hostRestrictions::get

The config server:hostRestrictions::get command enables you to get all the Agent (Host) Restrictions for a Server.

Agent (Host) Restrictions enables you to restrict the resources used and the number of concurrent jobs that you can execute on one or more Agents. This helps prevent resource overload.

CLI Syntax

Copy
ctm config server:hostRestrictions::get <server>

where server is the name of the Server.

REST API Syntax

cURL:

Copy
server=IN01
curl -H "x-api-key: $token" "$endpoint/config/server/$server/hostRestrictions"

config server:hostRestriction::add

The config server:hostRestriction::add command enables you to add an Agent (Host) restriction to an Agent.

Agent (Host) Restrictions enables you to restrict the resources used and the number of concurrent jobs that you can execute on one or more Agents. This helps prevent resource overload.

CLI Syntax

Copy
ctm config server:hostRestriction::add <server> <nodePrefix> <maxJobsAllowed> <maxCPUPct>

The following table describes the config server:hostRestriction::add command parameters.

Parameter

Description

server

Defines the name of the Server.

nodePrefix

Defines the name of the Agent where the host restrictions are added.

maxJobsAllowed

Determines the maximum number of jobs that can concurrently execute.

Valid Values:

  • UNLIMITED

  • 1–999,999

maxCPUPct

Determines the maximum percentage of CPU usage that the Agents can utilize.

Valid Values:

  • UNLIMITED

  • 1–100

REST API Syntax

cURL:

Copy
server=IN01
curl -H "x-api-token: $token" -H "Content-Type: application/json" -X POST \
-d "{\"nodePrefix\":\"ctm21200\",\"maxJobsAllowed\":\"UNLIMITED\",\"maxCPUPct\":\"80\"}" \
"$endpoint/config/server/$server/hostRestriction"

config server:hostRestriction::update

The config server:hostRestriction::update command enables you to update the Agent (Host) restrictions on an Agent.

CLI Syntax

Copy
ctm config server:hostRestriction::update <server> <nodePrefix> <maxJobsAllowed> <maxCPUPct>

The following table describes the config server:hostRestriction::update command parameters.

Parameter

Description

server

Defines the name of the Server.

nodePrefix

Defines the name of the Agent where host restrictions are updated.

maxJobsAllowed

Determines the maximum number of jobs that can concurrently execute.

Valid Values:

  • UNLIMITED

  • 1–999,999

maxCPUPct

Determines the maximum percentage of CPU usage that the Agents can utilize.

Valid Values:

  • UNLIMITED

  • 1–100

REST API Syntax

cURL:

Copy
server=IN01
curl -H "x-api-token: $token" -H "Content-Type: application/json" -X PUT \
-d "{\"nodePrefix\":\"ctm21200\",\"maxJobsAllowed\":\"UNLIMITED\",\"maxCPUPct\":\"80\"}" \
"$endpoint/config/server/$server/hostRestriction"

config server:hostRestriction::delete

The config server:hostRestriction::delete command enables you to remove all the Agent (Host) restrictions on one or more Agents.

CLI Syntax

Copy
ctm config server:hostRestriction::delete <server> <nodePrefixes>

The following table describes the config server:hostRestriction::delete command parameters.

Parameter

Description

server

Defines the name of the Server.

nodePrefixes

Defines a CSV list of one or more Agents where all host restrictions are removed.

REST API Syntax

cURL:

Copy
server=IN01 
nodePrefixes = "agent1,agent2"
curl -H "x-api-token: $token" -X DELETE "$endpoint/config/server/$server/hostRestriction?nodePrefix=$nodePrefixes"