Setting Up Devices in Nautobot for Tom
This guide walks through configuring a device in Nautobot so that Tom can manage it.
Prerequisites
Before adding devices, ensure:
- Tom is configured for Nautobot - See Nautobot Inventory
- Credential mapping is configured - Either custom field or config context
- Credentials are stored in Vault - See Vault Credentials
Credential Mapping Options
Tom can read credential IDs from either a custom field or config context. See Nautobot Inventory for full configuration options.
Option A: Custom Field (Default)
Create a custom field in Nautobot:
- Go to Extensibility > Custom Fields
- Click Add
- Configure:
- Content Types:
dcim | device - Type: Text
- Label:
credential_id - Key:
credential_id - Save
Option B: Config Context
No custom field needed. Add credential info to device config context:
{
"tom": {
"credential_id": "my_creds"
}
}
Configure Tom to read from config context:
plugin_nautobot_credential_source: config_context
plugin_nautobot_credential_field: tom.credential_id
Adding a Device
Step 1: Create Prefix (if needed)
The management IP must belong to a prefix. If the subnet doesn't exist:
- Go to IPAM > Prefixes
- Click Add
- Enter the prefix (e.g.,
10.1.2.0/24) - Set Status to Active
- Save
Step 2: Create IP Address
- Go to IPAM > IP Addresses
- Click Add
- Enter the management IP with mask (e.g.,
10.1.2.3/32) - Set Status to Active
- Save
Note: The IP must fall within an existing prefix.
Step 3: Create Device
- Go to Devices > Devices
- Click Add
- Fill in required fields:
- Name: Device hostname
- Device Type: Select appropriate type
- Role: Select role (e.g., Router, Switch)
- Location: Select location
- Status: Active
- Set Platform (optional but recommended):
- Select a platform that has
netmiko_device_typeconfigured - If not set, Tom uses its default driver
- Set the credential_id custom field:
- Enter the credential name stored in Vault
- Save (don't set Primary IP yet - we need an interface first)
Step 4: Create Interface
- On the device page, go to Interfaces
- Click Add
- Configure:
- Name: Interface name (e.g.,
Management0,GigabitEthernet0/0) - Type: Select appropriate type
- Save
Note: Interfaces can also be on modules (line cards) rather than directly on the device.
Step 5: Assign IP to Interface
- Edit the interface created in Step 4
- In IP Addresses, select the IP created in Step 2
- Save
Alternatively, edit the IP address and assign it to the interface from there.
Step 6: Set Primary IP
- Edit the device
- Set Primary IPv4 to the management IP
- Save
The Primary IP dropdown only shows IPs assigned to the device's interfaces.
Step 7: Store Credential in Vault
If the credential doesn't already exist:
uv run credload.py put <credential_id> -u <username> -p <password>
The <credential_id> must match what you entered in the device's custom field.
Verification
Check Device in Tom
# List all devices Tom can see
curl "http://localhost:8000/api/inventory/export" \
-H "X-API-Key: your-api-key"
# Check specific device
curl -X POST "http://localhost:8000/api/device/<device-name>/send_command" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"command": "show version", "wait": true}'
What Tom Reads from Nautobot
| Tom Field | Nautobot Source (configurable) |
|---|---|
| Host/IP | primary_ip4 (or primary_ip6, or device name as fallback) |
| Credential | Custom field or config context (per credential_source setting) |
| Adapter | Custom field or config context (per adapter_source setting), or default |
| Driver | Custom field or config context (per driver_source setting), or default |
See Nautobot Inventory for full configuration options.
Example: Working Device
The minimum fields Tom needs from a Nautobot device:
| Field | Example | Notes |
|---|---|---|
| Name | router1 |
Device identifier |
| Status | Active | Must match Tom's status filter |
| Primary IPv4 | 10.1.2.3/32 |
How Tom connects to the device |
| Credential ID | lab_creds |
Via custom field or config context; must exist in Vault |
Troubleshooting
Device Not Found in Tom
- Check the device exists in Nautobot
- Verify device status matches Tom's filter (default:
Active) - Check Tom controller logs for Nautobot API errors
Connection Failures
- Verify
primary_ip4is set and reachable - Check
credential_idmatches a credential in Vault - Verify the credential has correct username/password
- Check platform driver is correct for the device OS
Wrong Driver Being Used
- Check if device has a platform assigned
- Verify platform has
netmiko_device_typeset - Or update Tom's default driver in config
List Credentials in Vault
uv run credload.py list