Cherwell Integration
Use the Device42-Cherwell integration to sync discovered infrastructure assets and configuration items (CIs) from Device42 to your Cherwell CMDB.
The Device42-Cherwell integration requires a working Cherwell installation, Device42 instance, and assumes a Linux server with Python version 3.5 or later.
Configuring Cherwell
To prepare Cherwell to accept relationship data from Device42, two new Configuration Item (CI) types must be created in Cherwell: one for apps and one for services.
Follow these steps to create the new CIs:
-
Open Cherwell Service Management Administrator and on the left-side menu under Common Tasks, choose Create a new Blueprint (optionally, edit an existing Blueprint):

-
Create a new CI type for Applications called
Config-Applicationby clicking New Business Object and defining the object:
-
Obtain the Internal ID of the new Application Business Object CI you just created (you'll need it for the config file) before closing the window by selecting the Advanced icon and clicking Business Object ID:

-
Edit the properties of your new Application Business Object CI, and add the fields
u_device42_idof typeTextand size15, andu_device42_url, of typeTextand size300:
-
Add a second new CI business object named
Config-Serviceto Cherwell for Services by repeating Steps 2-4.
Configuring the Device42-Cherwell Integration
To sync your discovered hardware, servers, software, services, or assets (CIs) from Device42 to Cherwell, configure the integration:
- Download the integration from the Device42 Cherwell Integration page, and unzip the folder to the directory of your choice.
- Download the sample
mapping.xmlconfiguration file from Device42's GitHub and put it into the folder you created in Step 1. - Configure the integration credentials to allow connection between Device42 and Cherwell:
- Save a copy of
mapping.xml.sampleasmapping.xml. - Enter your Cherwell and Device42 URLs, user names, and passwords in their respective sections (lines 3-11), and for Cherwell only, the
client_id- find it in your Cherwell instance under Cherwell Service Management Administration > Security > Edit REST API Client Settings > Client Key.
- Save a copy of
- Configure the tasks section (below the credential settings) by entering the Cherwell Business Object IDs you saved from above, mapping each Device42 API resource to be synced (the
resourcevalue) to the appropriate fields in Cherwell (thetargetvalue). It is very important to ensure you've updated the configuration completely, mapping all of the details you are syncing from Device42 to their appropriate default endpoints in Cherwell (for example,service_level). Should you have trouble or need debugging, there is aDEBUGvariable inlib.pywhich can be set toTrueorFalse. - Execute a one-time CI sync by running the following command:
python sync.py. - Schedule your syncs to run automatically by adding a
crontabentry that will executesync.pyas often as you deem necessary, depending on the rate of change in your environment and existing discovery job schedules. This crontab generator can help you generate crontab syntax appropriate for your schedule. This example runs twice a day at noon and midnight:
0 */12 * * * python sync.py >/dev/null 2>&1
Application Group Configuration for Cherwell
The latest Device42 version is required.
Creation of Application Groups in Cherwell is not enabled by default. To enable Application Groups in mapping.xml, relevant attributes are as follows:
Copy Application Group data from Device42 to Cherwell: Can betrueorfalse. Enable or disable Application Group mapping in Cherwell (disabled by default).reset-connections: Can betrueorfalse. A setting oftrueresets all existing upstream and downstream service relationships, removing them from Cherwell before new relationships are processed (enabled by default).
Tasks must contain at least the following three tags:
- For Service Instances (called
Config-Service CIin Cherwell,serviceinstancein Device42) - For Application Components (
Config-ApplicationCI in Cherwell,appcompin Device42) - For Devices (
devicein Device42).
Multiple device entries can be present if devices are mapped to several CIs in Cherwell.
Each section must contain the following attributes:
d42-model: The name of the CI (model) in Device42bus-ob-id: The business object ID of CI in Cherwell
Each section must contain one or more upstream and downstream relationships. The section represents a one-to-many downstream relationship and must contain the following attributes:
d42-model: The name of the CI (model) in Device42 of the 'child' in relationshipid: The ID of the relationship (theCI links Downstream CIsrelationship should be used in most cases). This value can be obtained in Cherwell from Cherwell Service Management Administration > blueprint > Config > Edit relationships... > relationship > Edit > Advanced > Relationship ID. Please make sure the relationship has a reversed one (Upstream).
The Service Instances and Application Components sections must include the section for creating new objects in Cherwell. Mappings are not applicable for devices, as they should be processed in their own tasks.
Consult the examples in the mapping.xml.sample file.