Device42-Cherwell integration requires a working Cherwell installation, Device42 instance, and assumes a Linux server with python 3.5+.
To prepare Cherwell to accept relationship data from Device42, two new CI types must be created within Cherwell: one for apps & one for services. The following steps will create them:
- 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 CI Business Object 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_id, type ‘text’, size:15 &
u_device42_url, type ‘text’, size:300:
- Add a second new CI business object named
Config - Serviceto Cherwell for Services by repeating steps #2-4 again.
Configuring the D42-Cherwell integration
To sync your autodiscovered hardware, servers, software, services, and/or assets, etc. (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
- Enter your Cherwell & 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: 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 (the
targetvalue). 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 a
lib.pywhich can be set to
- Execute a one-time CI sync by running the following command:
- Schedule your syncs to run automatically by adding a
crontabentry that will execute
sync.pyas often as you deem necessary, depending on the rate of change in your enviornment & existing discovery job schedules. This crontab generator can help you generate crontab syntax appropriate for your schedule. This example runs twice a day @ noon & midnight:
0 */12 * * * python sync.py >/dev/null 2>&1
Affinity Group Configuration for Cherwell
Device42 version v15.11.07+ required
Creation of Affinity Groups in Cherwell is not enabled by default. To enable affinity groups in
mapping.xml. Relevant Attributes are as follows:
Copy Affinity Group data from Device42 to Cherwell: true/false. Enable/disable Affinity Group mapping in Cherwell – disabled by default.
reset-connections: true/false. A setting of
trueresets all existing upstream/downstream service relationships, removing them from Cherwell before new relationships are processed – enabled by default.
Tasks must contain at least the following 3 tags:
- For Service Instances (aka Config-Service* CI in Cherwell; serviceinstance in Device42)
- For Application Components (aka Config-Application* CI in Cherwell; appcomp in Device42)
- For Devices (aka device in Device42). Several for devices can be present if devices are mapped to several CIs on Cherwell.
Each section must contain the following attributes:
d42-model: the name of CI(model) in Device42
bus-ob-id: the business object ID of CI in Cherwell
Each section must contain one or more upstream/downstream relationships (section). The section represents 1 <-> Many downstream relationship and has to contain the following attributes:
d42-model: the name of CI(model) in Device42 of the ‘child’ in relationship
id: the ID of relationship (the CI links Downstream CIs relationship should be used in common case). This value can be obtained in Cherwell from Cherwell service management administration -> blueprint -> Config – * -> Edit relationships… -> relationship -> Edit -> Advanced -> Relationship ID. For proper working, please make sure that used relationship has the 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 since they should be processed in own tasks.
Consult the examples in the