Usage Alerts Configuration

The following API commands enable you to configure Usage Alerts, which notify you when the number of tasks in a Control-M/Enterprise Manager environment exceed the permitted limit of tasks in the Active Jobs file.

This feature requires Control-M/EM version 9.0.27 or higher.

config usage:alerts::disable

The config usage:alerts::disable command turns off usage alerting in the environment.

  • CLI

  • REST

ctm config usage:alerts::disable

The following example shows the REST API syntax for the config usage:alerts::disable command in cURL.

Copy
AuthHeader="x-api-key: $token"
# AuthHeader="Authorization: Bearer $token"  #for a session token

curl -H -X POST "$AuthHeader" \
"$endpoint/config/usage/alerts/disable"

To determine the correct AuthHeader value—"Authorization: Bearer $token" or "x-api-key: $token"—see Authentication Tokens.

config usage:alerts::enable

The config usage:alerts::enable command turns on usage alerting in the environment.

  • CLI

  • REST

ctm config usage:alerts::enable

The following example shows the REST API syntax for the config usage:alerts::enable command in cURL.

Copy
AuthHeader="x-api-key: $token"
# AuthHeader="Authorization: Bearer $token"  #for a session token

curl -H -X POST "$AuthHeader" \
"$endpoint/config/usage/alerts/enable"

To determine the correct AuthHeader value—"Authorization: Bearer $token" or "x-api-key: $token"—see Authentication Tokens.

config usage:alerts:state::get

The config usage:alerts:state::get command retrieves the current status of usage alerting in the environment, whether enabled or disabled.

  • CLI

  • REST

ctm config usage:alerts:state::get

The following example shows the REST API syntax for the config usage:alerts:state::get command in cURL.

Copy
AuthHeader="x-api-key: $token"
# AuthHeader="Authorization: Bearer $token"  #for a session token

curl -H -X GET "$AuthHeader" "$endpoint/config/usage/alerts/state"

To determine the correct AuthHeader value—"Authorization: Bearer $token" or "x-api-key: $token"—see Authentication Tokens.

config usage:alerts::get

The config usage:alerts::get command enables you to get the current usage alert settings.

  • CLI

  • REST

ctm config usage:alerts::get

The following example shows the REST API syntax for the config usage:alerts::get command in cURL.

Copy
AuthHeader="x-api-key: $token"
# AuthHeader="Authorization: Bearer $token"  #for a session token

curl -H -X GET "$AuthHeader" "$endpoint/config/usage/alerts"

To determine the correct AuthHeader value—"Authorization: Bearer $token" or "x-api-key: $token"—see Authentication Tokens.

Response

The following sample response presents the usage alert settings:

Copy
{
  "usageAlerts": [
    {
      "platform": ALL,
      "maxCount": "3",
      "percent": "75",
      "email": [
        "[email protected]",
        "[email protected]"
      ]
    }
  ]
}

The following table describes the config usage:alerts::get response details that are shown in the above response:

Parameter

Description

platform

Determines the Control-M/EM platform type where task counts and alerts are implemented:

  • MVS

  • MPM

  • ALL

maxCount

Indicates the maximum number of permitted tasks in the Control-M/EM environment.

percent

Indicates the percentage of the permitted tasks that triggers an alert when the level is exceeded.

email

Lists the email addresses of the alert recipients.

config usage:alerts::set

The config usage:alerts::set command enables you to change usage alert settings.

  • CLI

  • REST

ctm config usage:alerts::set -f <alertSettingsFile>

The following example shows the REST API syntax for the config usage:alerts::set command in cURL.

Copy
AuthHeader="x-api-key: $token"
# AuthHeader="Authorization: Bearer $token"  #for a session token

curl -H -X POST "$AuthHeader" -H "Content-Type: application/json" \
--data "@c:\tmp\usageAlertSettings.json" "$endpoint/config/usage/alerts"

To determine the correct AuthHeader value—"Authorization: Bearer $token" or "x-api-key: $token"—see Authentication Tokens.

<alertSettingsFile> is the full path to a JSON file that contains Usage Alert settings.

To create this file, you can obtain the current settings from the config usage:alerts::get command response, save this response as a JSON file, and adjust the settings that you want to modify.

The following table describes the Usage Alert settings that you can include in the Alert Settings file for the config usage:alerts::set command:

Parameter

Description

platform

Determines the Control-M/EM platform type where task counts and alerts are implemented:

  • MVS

  • MPM

  • ALL

maxCount

Determines the maximum number of permitted tasks in the Control-M/EM environment.

percent

Determines the percentage of the permitted tasks that triggers an alert when the level is exceeded.

Values: 50–100

email

Defines the email addresses of the alert recipients.

config usage:alerts:connectivity::test

The config usage:alerts:connectivity::test command enables you to check connectivity to the Control-M/EM environment where task counts and alerts are implemented.

  • CLI

  • REST

ctm config usage:alerts:connectivity::test -f <environmentSettingsFile>

The following example shows the REST API syntax for the config usage:alerts:connectivity::test command in cURL.

Copy
AuthHeader="x-api-key: $token"
# AuthHeader="Authorization: Bearer $token"  #for a session token

curl -H -X POST "$AuthHeader" -H "Content-Type: application/json" \
--data "@c:\tmp\environmentSettingsFile.json" \
"$endpoint/config/usage/alerts/connectivity/test"

To determine the correct AuthHeader value—"Authorization: Bearer $token" or "x-api-key: $token"—see Authentication Tokens.

<environmentSettingsFile> is the full path to a JSON file that contains environment connection settings, as in the following example:

Copy
{
   "name": "em_env_1",
   "dbType": Oracle,
   "host": "db-host-name",
   "port": "546",
   "userName": "jdoe",
   "password": "********",
   "dbName": "Ora_DB"
}

The following table describes the environment connection settings that you can include in the Environment Settings file for the config usage:alerts:connectivity::test command:

Parameter

Description

name

Defines the name of the environment.

dbType

Determines one of the following database types:

  • PostgreSQL

  • Oracle

  • MSSQL

host

Defines the database hostname.

port

(PostgreSQL or Oracle) Defines the database port number.

Values: 1–65535

userName

(PostgreSQL or Oracle) Defines the username for login to the database.

password

(PostgreSQL or Oracle) Defines the password for login to the database.

dbName

(PostgreSQL or Oracle) Defines the database name.