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

# NetBox

NetBox is an infrastructure resource modeling tool used for IP address management and as a source of truth. OctoXLabs reads the virtual machines recorded in NetBox and adds them to the device inventory.

## Use cases

* List the virtual machines recorded in NetBox.

```
Adapters = netbox
```

* Find NetBox virtual machines that no EDR agent covers.

```
Adapters = netbox AND NOT Groups = edr
```

## Before you begin

### Network

| Source              | Destination   | Port                        | Protocol                     |
| ------------------- | ------------- | --------------------------- | ---------------------------- |
| OctoXLabs connector | NetBox server | 443 (default, configurable) | HTTPS (HTTP when SSL is off) |

### Required permissions

| Scope or role          | Permission | Needed for                                         |
| ---------------------- | ---------- | -------------------------------------------------- |
| Token with read access | Read       | `virtualization.virtualmachine` (virtual machines) |

The frontend instructions only say to generate an API token on the API tokens page. The connector reads only the virtual machines endpoint. Token permission model not verified.

## Create credentials in NetBox

{% stepper %}
{% step %}

### Sign in

Log in to NetBox with your user name and password.
{% endstep %}

{% step %}

### Create a token

Open the API tokens page under your user profile and generate a token. See the NetBox REST API authentication documentation (<https://demo.netbox.dev/static/docs/rest-api/authentication/>).
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                     | Required | Type    | Default | Description                                                                |
| ----------------------------- | -------- | ------- | ------- | -------------------------------------------------------------------------- |
| IP (`ip`)                     | Yes      | String  |         | IP address or host name of the NetBox server.                              |
| Port (`port`)                 | No       | Integer | 443     | NetBox port.                                                               |
| API Token (`api_token`)       | Yes      | String  |         | NetBox API token.                                                          |
| SSL (`is_secure`)             | No       | Boolean | True    | Use HTTPS.                                                                 |
| Timeout (`timeout`)           | No       | Integer | 30      | Seconds to wait for API responses.                                         |
| Thread Count (`thread_count`) | No       | Integer | 32      | Parallel threads for API requests (min 1, max 32).                         |
| Sleep Time (`sleep_time`)     | No       | Integer | 0       | Delay in seconds between thread batches. Increase it on rate limit errors. |

## Troubleshooting

| Error message                              | Cause                                       | Fix                                                                         |
| ------------------------------------------ | ------------------------------------------- | --------------------------------------------------------------------------- |
| NetBox page request failed, skipping page: | A page request failed. The page is skipped. | Check connectivity and rate limits. Raise Sleep Time or lower Thread Count. |

## Change history

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