For those of us using a terminal manager and Netbox, we often find ourselves duplicating work; add the device to Netbox, then add the device to our terminal manager. The situation gets a little more complicated when other teams add devices autonomously. In this post, I present a simple solution I've developed for Netbox users to import their device data straight into RoyalTS without having to manually add devices.
RoyalTS provides dynamic-folder as an option to call a script that returns JSON describing a list of devices, credentials, folders, etc. We can use this feature along with the Netbox API to pull our interesting devices into RoyalTS
https://github.com/MajesticFalcon/RoyalTS_Netbox_Integration/blob/main/main.py
To create a dynamic-folder in RoyalTS, right-click connections, click 'Add' and select "dynamic folder." In the new pop-up window, select 'Dynamic Folder Script' and paste the script found above. Adjust the script with your Netbox URL and token. You may also adjust some filters and device_roles to match your environment.
import urllib3
nb.http_session.verify = False
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
Once created, right-click the new folder and select 'reload.'
For purposes of this demo, I have created several new sites – Site A, Site B, etc. Each site has at least one switch.
Old workflow:
New workflow:
Now you and your teammates can have a 'single-source-of-truth' backed terminal manager!