Skip to main content

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:

  1. 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 new or Open Blueprint

  2. Create a new CI type for Applications called Config-Application by clicking New Business Object and defining the object:

    Create new CI for applications

  3. 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:

    Cherwell CI business object internal ID

  4. Edit the properties of your new Application Business Object CI, and add the fields u_device42_id of type Text and size 15, and u_device42_url, of type Text and size 300:

    Add new custom fields to Cherwell business object CI

  5. Add a second new CI business object named Config-Service to 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:

  1. Download the integration from the Device42 Cherwell Integration page, and unzip the folder to the directory of your choice.
  2. Download the sample mapping.xml configuration file from Device42's GitHub and put it into the folder you created in Step 1.
  3. Configure the integration credentials to allow connection between Device42 and Cherwell:
    • Save a copy of mapping.xml.sample as mapping.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.
  4. 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 resource value) to the appropriate fields in Cherwell (the target value). 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 DEBUG variable in lib.py which can be set to True or False.
  5. Execute a one-time CI sync by running the following command: python sync.py.
  6. Schedule your syncs to run automatically by adding a crontab entry that will execute sync.py as 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 be true or false. Enable or disable Application Group mapping in Cherwell (disabled by default).
  • reset-connections: Can be true or false. A setting of true resets 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 CI in Cherwell, serviceinstance in Device42)
  • For Application Components (Config-Application CI in Cherwell, appcomp in Device42)
  • For Devices (device in 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 Device42
  • bus-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 relationship
  • id: The ID of the relationship (the CI links Downstream CIs relationship 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.