Dynamic Inventory from script or api

Dynamic Inventory from script or api

avatar

We use netbox as our source of truth for our network. We would like to be able to use this as a data source or inventory source. RoyalTS has a feature called dynamic folder which allows you to run a script to generate your inventory. I was wondering if there was similar functionality in RDM or a way to achieve the same outcome.

All Comments (5)

avatar

Hello !

Thank you for contacting the Devolutions Support Desk !

Our RDP entries have an option called "Load from Inventory" in the Assets section of the application: forum image

If there's an issue with the option here's an article covering some common issues and solutions: https://kb.devolutions.net/rdm_wmi_troubleshooting.html

Best Regards,

avatar

This isn't exactly what I'm looking for. Our workflow is we provision a vm with terraform. During provisioning terraform also adds the vm details to netbox. Once provisioning completes we then manually add the session details to the datasource in RDM. I would like to be able to eliminate this last manual step. With royalTS dynamic folders, we created a script that queries netbox and generates all the connection profiles automatically. This way anything we provision is automatically available in royal right away.

avatar

Hello,

By using a PowerShell script, you should be able to populate the sessions in RDM. Could you send us the script you had in RoyalTS? You can send it to service@devolutions.net if you do not want to make it public.

Alternatively, if you can generate a CSV file from NetBox, you can use a CSV Synchronizer to populate the entries in RDM. You can also initiate the synchronization by using the Open-RDMSyncSession cmdlet.

Best regards,

Richard Boisvert

avatar

Do you have an example PowerShell script on how you would synchronize entries? Where would this script run, in rdm or in a terminal? Our royal script is already powershell, so updating to work with rdm shouldn't be that difficult.

avatar

Hello,

If you were to use a CSV Synchronizer in RDM, you can run a script like the following on a server, even if RDM is not installed on it.

To create a new data source in PowerShell, you can execute this line, it assumes it is a SQL Server data source with a SQL login, it can be modified for your needs. It is only required once, and if RDM is not installed.

New-RDMDataSource -SQLServer -Database 'database name' -Server 'server name' -Username 'username' -Password <SecureString> -Name 'NameOfYourDataSourceHere' -SetDatasource


Then, you can reference that data source and run the synchronizer

#connect to the data source
$ds = Get-RDMDataSource -Name "NameOfYourDataSourceHere"
Set-RDMCurrentDataSource $ds

#move to the correct vault
$repository = Get-RDMRepository -Name "MyVault"
Set-RDMCurrentRepository $repository

#run the synchronizer
$sync = Get-RDMSession -name "CSV-Sync"
$result = Open-RDMSyncSession -Session $sync


forum image

Depending on what your PowerShell does, you could import the entries directly with the PowerShell as well, without using the CSV Synchronizer.

Best regards,

Richard Boisvert