Custom Integration for retrieving clients and Unifi devices from the Unifi Network API
- Superuser access to the Custom Integrations configuration in runZero.
- Network API Key
- Unifi Site Name (default:
Default) - Unifi Gateway URL
- Generate a API Token in Unifi at
Network -> Settings -> Control Plane -> Integrations - Test your API token by making a sample request using a tool like
curlor Postman to verify access.
- Make any necessary changes to the script to align with your environment.
- Set
UNIFI_CONTROLLER_URL - Set
UNIFI_SITE_NAME - (OPTIONAL) Disable client extract with
EXTRACT_CLIENTS = False - (OPTIONAL) Disable device extract with
EXTRACT_DEVICES = False - (OPTIONAL) Modify
UNIFI_CLIENT_API_FILTER
- Set
- Create the Credential for the Custom Integration.
- Select the type
Custom Integration Script Secrets. - Use the
access_secretfield for your Unifi API token. - For
access_key, input a placeholder value likefoo(unused in this integration).
- Select the type
- Create the Custom Integration.
- Add a Name and Icon for the integration (e.g., "unifi").
- Toggle
Enable custom integration scriptto input the finalized script. - Click
Validateto ensure it has valid syntax. - Click
Saveto create the Custom Integration.
- Create the Custom Integration task.
- Select the Credential and Custom Integration created in steps 2 and 3.
- Update the task schedule to recur at the desired timeframes.
- Select the Explorer you'd like the Custom Integration to run from.
- Click
Saveto kick off the first task.
- You will see the task kick off on the tasks page like any other integration.
- The task will update the existing assets with the data pulled from the Custom Integration source.
- The task will create new assets for when there are no existing assets that meet merge criteria (hostname, MAC, etc).
- You can search for assets enriched by this custom integration with the runZero search
custom_integration:unifi.