> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/b/bmc-control-m.md).

# BMC Control M

BMC Control-M is a workload automation platform that runs jobs on agents. OctoXLabs reads the Control-M/Server hosts and the Control-M agents as devices, and the Control-M users as users, through the Automation API.

## Use cases

* List agents and servers that report a version (Devices).

```
Adapters = bmc-control-m AND AgentVersions = *
```

* List Control-M users and their groups (Users).

```
Adapters = bmc-control-m AND MembersOf = *
```

## Before you begin

### Network

| Source              | Destination                                                                                          | Port                                      | Protocol                         |
| ------------------- | ---------------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------------------- |
| OctoXLabs connector | Control-M Automation API host (IP or host name you enter). SaaS: `<tenant>-aapi.<zone>.controlm.com` | 8443 self-hosted, 443 SaaS (configurable) | HTTPS (HTTP if Is Secure is off) |

### Required permissions

| Scope or role                                                                      | Permission | Needed for                |
| ---------------------------------------------------------------------------------- | ---------- | ------------------------- |
| Role that can browse Control-M/Server and Agent configuration, and Control-M users | Read       | Servers, agents and users |

## Create credentials in BMC Control-M

{% stepper %}
{% step %}

### Choose the authentication

SaaS needs an API key (an Automation API token). Self-hosted can use an API key or a Control-M username and password. When an API key is set, username and password are not used.
{% endstep %}

{% step %}

### Create the token (API key)

Create an Automation API token in the Control-M web interface.
{% endstep %}

{% step %}

### Check the role

The token or user needs a role that can browse the Control-M/Server and Agent configuration and the Control-M users. Assets outside the role scope are not collected.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter | Required | Type    | Default | Description                                                                                                                          |
| --------- | -------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| IP        | Yes      | String  |         | Self-hosted: IP or host name of the Control-M/Enterprise Manager that runs the Automation API. SaaS: the tenant Automation API host. |
| Port      | No       | Integer | 8443    | Automation API port. Use 443 for SaaS.                                                                                               |
| Is Secure | No       | Boolean | True    | Use HTTPS.                                                                                                                           |
| API Key   | No       | String  |         | Automation API token, sent in the `x-api-key` header. Required for SaaS.                                                             |
| Username  | No       | String  |         | Self-hosted only. Used when no API key is given.                                                                                     |
| Password  | No       | String  |         | Password of that user.                                                                                                               |
| Proxy     | No       | String  |         | Proxy as `host:port`.                                                                                                                |
| Timeout   | No       | Integer | 30      | Seconds to wait for API responses.                                                                                                   |

## Troubleshooting

| Error message                                                                  | Cause                                                                                                                                  | Fix                                                                                                  |
| ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| api\_key or username and password required.                                    | Neither an API key nor a full username and password is set.                                                                            | Fill in the API key, or both username and password.                                                  |
| No token in the response of                                                    | The login answered without a token.                                                                                                    | Check the username and password.                                                                     |
| No Control-M/Server returned from /config/servers, no agents can be collected. | The role sees no servers.                                                                                                              | Check the role scope.                                                                                |
| Skipping agents of Control-M/Server : HTTP                                     | One server was unreachable or refused. Other servers continue. A 401 stops the run.                                                    | Check that server and the token.                                                                     |
| Status Code: `, URL, Method`                                                   | The API answered with an unexpected HTTP status. The shared request code raises it and logs the status, URL, method and response body. | Check the URL, the credentials and the permissions listed above, then run the connection test again. |

## Change history

{% hint style="info" %}
Available starting from version 6.9.1.
{% endhint %}
