Docs
On this page
task3 min readApplication: CMDB

Import Lansweeper assets into the CMDB

Connect Lansweeper Cloud to Servicely, test an import of one asset class and schedule it.

Import devices discovered by Lansweeper Cloud into the CMDB, one CI class at a time. This page is for administrators who set up the integration, ideally on a non-production instance first.

Before you begin

  • You need the administrator role.
  • You need a Lansweeper Cloud account that can create an integration app. The integration works with the Cloud edition of Lansweeper. For an on-premises Lansweeper, contact Servicely Support.
  • If you have already built your own Lansweeper integration, contact Servicely Support before you activate this one.
  • Choose the Lansweeper asset types to test with and the CMDB table they belong in. Lansweeper groups many devices by operating system, so a Servicely class such as servers often needs a filter across several asset types.
  • Import each attribute from one system only. Lansweeper also collects data from other sources, so do not import the same attribute from both.

Steps

  1. Activate the Lansweeper integration application [UNVERIFIED].

  2. In Lansweeper, create an integration app by following the Lansweeper quickstart. Set its callback URL to https://<instance-name>.servicely.ai/sso/oauth_callback. Keep the client ID, client secret and authorization URL in Lansweeper until you enter them in the next step.

  3. In Servicely, go to Administration → Integration → System OAuth providers and create a provider with the values in the table below.

    Field Value
    Authentication method Request body
    Authorization URL https://app.lansweeper.com/authorize-app/<client_id>
    Token URL https://api.lansweeper.com/api/integrations/oauth/token
    Redirect URL https://<instance-name>.servicely.ai/sso/oauth_callback
  4. Go to Administration → Integration → System API outbound tokens and create an OAuth2 token for that provider. Set OAuth Prompt to consent and Scopes to offline_access.

  5. On the token, select Get authorization token and sign in with a Lansweeper account.

  6. Create an import table for the class. Any name works. A pattern such as <prefix>Lansweeper<Class>Import keeps them easy to find. You do not need to generate the temporary table before the first import.

  7. Open the LansweeperIntegration property set and fill in the global properties and the properties for your class. Keep the class’s transform property, for example LansweeperIntSwitchEnableTransform, set to false and set the page limits low, for example 5, so the first run is quick to check. The Lansweeper integration properties reference lists each one.

  8. Run the import once from a server script. The first argument is the class name used in your property names. The second is the page to start at. Keep it at 1.

    LansweeperIntUtil.lansweeperIntegrationEntryPoint("Switch", 1);
    
  9. Check the rows in your import table. If the fields or the filter are wrong, change the class properties and run the import again. Errors appear in the system log.

  10. When the data is right, delete the rows from the import table and create a transform map from it to the CMDB table. Use the Lansweeper key as the primary key. Set the class’s transform map property, for example LansweeperIntSwitchTransformMap, set its transform property to true and raise the page limits so a run loads every record.

  11. Set up a system table cleanup record for the import table.

  12. Go to Jobs and activate the job for your class. The integration ships a sample job for switches, (Lansweeper) Load Switches, which runs daily.

Result

The job imports the class from Lansweeper’s GraphQL assetResources query on its schedule and transforms the rows into the CMDB. If a run reaches the page limit, it stops reading pages and does not transform. Repeat the steps from the import table onwards for each further class.

Last updated 18 October 2026commit 5ea5eb0dd83dChris Jones
Back to top