> 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/n/netbrain.md).

# NetBrain

NetBrain is a network automation and documentation platform. OctoXLabs reads network devices and users from the NetBrain CMDB through the Open API.

## Use cases

* List the network devices that NetBrain reports.

```
Adapters = netbrain
```

* Find NetBrain devices not seen by discovery for 30 days.

```
Adapters = netbrain AND NOT LastSeen last now-30d/d
```

## Before you begin

### Network

| Source              | Destination             | Port                        | Protocol                           |
| ------------------- | ----------------------- | --------------------------- | ---------------------------------- |
| OctoXLabs connector | NetBrain Web API Server | 443 (default, configurable) | HTTPS (HTTP when Is Secure is off) |

### Required permissions

| Scope or role                | Permission | Needed for             |
| ---------------------------- | ---------- | ---------------------- |
| OAuth client bound to a user | Read       | CMDB devices and users |

Data is scoped to the NetBrain Access Control Policy of the bound user. Grant the user access to the devices you want to collect. A user whose policy restricts some devices returns fewer results.

## Create credentials in NetBrain

{% stepper %}
{% step %}

### Add an OAuth client

In NetBrain, go to Open API > Add OAuth Client.
{% endstep %}

{% step %}

### Bind it to a user

Bind the client to a user whose Access Control Policy covers the devices you want.
{% endstep %}

{% step %}

### Copy the credentials

Copy the generated Client ID and Client Secret.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                       | Required | Type    | Default | Description                                             |
| ------------------------------- | -------- | ------- | ------- | ------------------------------------------------------- |
| IP (`ip`)                       | Yes      | String  |         | IP address or host name of the NetBrain Web API Server. |
| Port (`port`)                   | No       | Integer | 443     | NetBrain port.                                          |
| Client ID (`client_id`)         | Yes      | String  |         | OAuth Client ID.                                        |
| Client Secret (`client_secret`) | Yes      | String  |         | OAuth Client Secret.                                    |
| Is Secure (`is_secure`)         | No       | Boolean | True    | Use HTTPS.                                              |
| Timeout (`timeout`)             | No       | Integer | 30      | Seconds to wait for API responses.                      |

## Troubleshooting

| Error message                              | Cause                                            | Fix                                                       |
| ------------------------------------------ | ------------------------------------------------ | --------------------------------------------------------- |
| users skipped, no email or username found. | Some users have neither email nor username.      | Check the users in NetBrain. This is a log warning.       |
| Max retries exceeded for                   | The API kept returning 401 or 429 after retries. | Check the client credentials and wait for the rate limit. |

## Change history

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