# Resource Mapping

Resource mapping is essentially the same no matter the kind of resource you are mapping. &#x20;

## Mapping a New Resource

{% hint style="info" %}

### Before you start

You must have **Integration Setup** selected in your General Access Security Role.

**Mapping Priority and the Order of Import**

ASM will apply the mapping and match the external resource to the internal resource in the order in which the mappings appear in the Mappings (and Groups if relevant) browse table. If more than one mapping applies to an external resource, then the mapping that is higher in the list will be applied first, then the second one in the list, and so on.
{% endhint %}

1. In the **Groups** table, select the group for which you want to define a mapping.
2. Complete the details.

<table><thead><tr><th width="205">Source</th><th>This field is prefilled with the application or directory server for whose resources you want to configure the mapping.</th></tr></thead><tbody><tr><td>Resource Type</td><td>This field is prefilled with the category of the resource you are mapping.</td></tr><tr><td>Name</td><td>Type a name for the mapping. This name appears in the Mappings table. This is a mandatory field, and must be completed otherwise you will get a warning message on saving the mapping details.</td></tr></tbody></table>

### Criteria Tab

Select the **Criteria** tab to specify the criteria for selecting the external resource to import.

<table data-header-hidden><thead><tr><th width="196"></th><th></th></tr></thead><tbody><tr><td>Default Mapping</td><td><p>Select to specify that this is the default mapping for the resource type mapping you are working with.</p><p>Clear to set the conditions for applying this mapping to an external resource using the rules builder panel. These conditions are set through defining a rule. You can only select external resource fields or attributes as the criteria in your rule, since this is the criteria ASM Core must use to select external resources for importing.</p><p>You may wish to only import a resource, Computer, for a specific Manufacturer. In this case, you would select the criteria, “Manufacturer”, the operator, equal to (=), and the value as the name of the manufacturer.</p><p>It is useful to specify a default mapping so that resources that do not meet the criteria in any of the defined mappings for the resource type may still be discovered and updated.</p></td></tr></tbody></table>

### Action Tab

Select the **Action** tab and select a CMDB template and set the rules for applying the template, when the defined mapping criteria is met.

<table><thead><tr><th width="187">Import</th><th>Select to enable the fields on this tab. If you clear this option, external resources will not be imported or updated for this mapping when a scheduled scan runs on the source</th></tr></thead><tbody><tr><td>Import As</td><td>Select the entity type that will be created when the external resources are imported. An external resource can be imported as a Person, CMDB Item (Service, Config Item, Service Action, etc), Location, Organization, Contract, Knowledge Article, Subscriber Group, or Cost Center. Depending on the type of connector, not all the options may be displayed in this list.</td></tr><tr><td>Using template</td><td><p>Type the name of the template to apply to the CMDB items, People, etc created after the source is scanned for resources.</p><p>Only the templates/records for the entity type selected at <strong>Import As</strong> appear in this list.</p><p>For Person or CMDB Item, the relevant templates are displayed.</p><p>For other entity types, such as Knowledge or Organization, it is not possible to mark an item as a template, therefore all items that meet the search parameters are displayed in the search results. Select one to act as the template.</p></td></tr><tr><td>Apply template to CMDB Item or Person</td><td>Select when the template must be applied to the imported resource.</td></tr><tr><td>When a resource is discovered</td><td>Select the action to be taken on the CMDB if a new resource or person is discovered on the source.</td></tr><tr><td>When a resource is deleted</td><td>Select the action to be taken on the CMDB if a resource or person is deleted on the source.</td></tr><tr><td>When a deleted resource is restored</td><td>Select the action to be taken on the CMDB if a resource or person item is restored on the source.</td></tr><tr><td>Map to a Subscriber Group</td><td><p>Select this checkbox to allow a Subscriber Group to be mapped to a particular resource group.</p><p>When a scan is run, it will check against this resource mapping and either add a new record to the AR_SUBSCRIBER_GROUP_MEMBER table, or update a record already in there (for when a user is deleted or restored).</p><p>If you map, say, AD groups to Subscriber Groups, people are mapped to a subscriber group when an AD scan is run, rather than manually mapping them</p></td></tr><tr><td>Subscriber Group</td><td>Use the Search button to identify the Subscriber Group you want to use.</td></tr></tbody></table>

| Restore linked CMDB Item or Person automatically | instructs the polling service to discover any restored resources on the source and apply that information directly to the linked CMDB items or people. The CMDB items or people are restored immediately                                                                                                                             |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Add to the Activated Resources list              | instructs the polling service to take no immediate action on the CMDB. Instead, it records the detected differences for each definitive resource record, which you can review and then decide if you wish to restore. You can review the restored items in the Activated Resources List on the Federated CMDB Administration window. |
| Take no action                                   | instructs the polling service to make no change to the CMDB                                                                                                                                                                                                                                                                          |

| Delete linked CMDB Item or Person automatically | instructs the polling service to discover any deleted resources on the source and automatically delete the linked records                                                                                                                                                                                                     |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Add to the De-activated Resources list          | instructs the polling service to take no immediate action. Instead, it records the detected differences for each definitive resource record, which you can review and then decide if you wish to delete. You can review the deleted items in the **De-activated Resources List** on the Federated CMDB Administration window. |
| Take no action                                  | instructs the polling service to make no change to the data in ASM Core.                                                                                                                                                                                                                                                      |

| Create linked CMDB Item or Person automatically | instructs the polling service to discover any new resources on the source and, when a new resource is found, automatically create a new record in ASM Core and link this record to the record in the Federated CMDB                                                                     |
| ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Add to the Pending Imports list                 | instructs the polling service to take no immediate action. Instead, it records the detected definitive resource record, which you can review and then decide if you wish to create. You can review the items in the **Pending Import View** on the Federated CMDB Administration window |

| On creation only                           | applies the template to the imported resource only when the ASM Core record is created, that is, only if the resource does not match an existing item                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| On creation or update                      | applies the template to the imported resource when the ASM Core record is created, or when an existing (matching) ASM Core record is updated                                                                                                                                                                                                                                                                                                          |
| When template is different to last applied | <p>Applies the template to the imported resource only when the last template used on the matching ASM Core record is different to the current template set for this mapping (that is, if it is a different template altogether, or if it is the same template that has changed).</p><p>For a directory server integration connector, users may need to be imported under another Person template if their status changes on the directory server.</p> |
| When mapping is different to last applied  | applies the template to the imported resource when the last mapping used is different to this mapping                                                                                                                                                                                                                                                                                                                                                 |

### Fields Tab - Mapping Your Data

1. Select the **Fields** tab to map the fields to be updated through the import.
2. To add a field, select **Add**.
3. You can only map fields once you have selected an item in the **Using template** field in the **Actions** tab.
4. In the **Add Fields** window, select the ASM Core field you wish to map, and click OK.
5. To set the value for this field, on the fields browse table, click the cell in the **Resource Field** column
6. Select into the row. The available options appear in a multi-tier popup and are specific to the ASM Core field type.
7. You must select a resource field/value otherwise you will receive a warning message when you save the mapping details.
8. To set the condition for updating the field, make a selection in the Update column.

<table><thead><tr><th width="262">Always</th><th>populates the field automatically whenever this field mapping is picked up during a scheduled scan. This option is useful if the external source is the definitive place where this information resides.</th></tr></thead><tbody><tr><td>On Initial Population Only</td><td>populates the field only when a new record is created in ASM Core during a scheduled scan. This option is useful if this item may be updated from integrations with various external sources.</td></tr><tr><td>Only When Blank</td><td>populates the field only when it is blank. This is useful if the field on the external source is not the definitive place where this information resides, and should not have the ability to overwrite the field value.</td></tr><tr><td>Create Discrepancy Report</td><td>does not populate the field automatically when the field mapping is picked up during a scheduled scan. Rather, an entry is added to the Discrepancy Report view in the Federated CMDB Administration window, allowing you to decide whether the field may be updated or not. This is useful to detect unauthorized changes on the source.</td></tr></tbody></table>

1. To delete a mapped field, select the field, click **Remove** and confirm the deletion in the warning dialog box.
2. To restore the default mapping that may be provided for some connectors, and overwrite any new mappings you may have added, select **Restore Default**.
3. Learn more about fields available for mapping a directory server user to a person record in the CMDB in **Directory Server Fields**.

### Matching Tab

Set the criteria ASM Core will use to match a discovered external resource to an existing CMDB item. This step allows you to configure “rules” for importing and updating resources. This includes defining how users are imported through a directory integration source connector or other resources are imported through a network discovery connector. For example, by defining a rule using fields from the person details, you can match a new user discovered on a directory server to an existing person record in ASM Core.

1. Select the **Matching** tab.
2. Select **On discovery match resource** to enable the rules builder panel.
3. Specify the criteria that will be used to match a discovered resource or user to an existing CMDB item. This is done through adding a rule.
4. In the final part of the statement, select **> 1 matching records are identified** to add the discovered resource to the **Pending Imports** list in the **Federated CMDB Administration** window, if more than one record in the CMDB is matched to the resource based on the criteria. This allows you to manually match the resource to the CMDB item. Select **No matching records are identified** to add the discovered resource to the **Pending Imports** list in the **Federated CMDB Administration** window, if no record in the CMDB is matched to the resource based on the criteria.
5. Click **Save**. You are returned to the **Resource Types Mapping** window where you can add more mappings for this resource type if needed.

{% hint style="warning" %}

* Mappings are applied only when a resource is imported or updated. Changing the resource mappings will not update existing CMDB items. Updates are made only when ASM Core detects changes to a resource.
* Disabling scans for a connector or a specific resource type after a scan has been run will not delete CMDB items linked to the external resources for that connector. However, viewing any of these external resources (that may be linked to CMDB items) will display them as inactive.
* Resources are imported automatically during a Federated CMDB scan, and these resources are checked for any links that correspond to the mapped resource link types. This relationship information is automatically discovered by the scan; it cannot be regulated. However, you can choose not to import the relationship information as links into the CMDB when you import resources with links to other resources.
  {% endhint %}

## Directory Server Fields <a href="#director" id="director"></a>

{% hint style="danger" %}
**Resource Mapping Priority**

The import is iterative.  This means that for LDAP, for example, if you have people in more than one mapped group, each successive template from the **top down** will be applied to their person record and changes across each template will be applied if you have set your option to "Always Apply" the template.&#x20;

BEST PRACTICE: &#x20;

* Always have the high permission mappings at the bottom of the list
* Users should only belong to one group

```
Example: 
If John Doe is a member of the "Users" group and the "System
Admin" group, then you would want to put the "Users" group at the top of 
your mapping list and your "System Admin" group at the bottom of your list.

```

{% endhint %}

The person fields available for mapping a directory server user to a Person entity in ASM Core include the following:

<table data-header-hidden><thead><tr><th width="264"></th><th></th></tr></thead><tbody><tr><td>Login ID</td><td><p>allows you to link an analyst or User from a directory server to a person in ASM Core using the Login ID details.</p><p>When person record is deleted from ASM Core based on a disabled Active Directory record, their Login ID and Password fields are deleted within ASM Core will be available for reuse.</p></td></tr><tr><td>Email</td><td>allows you to link a user from a directory server to a person record in ASM Core using the email details.</td></tr><tr><td>First Name and Surname</td><td>allows you to link a user from a directory server to a person record in ASM Core using the First Name and Surname.</td></tr></tbody></table>

## Selecting Fields for Mapping

The table below provides a summary of the field types and values you can select when mapping Internal Fields and External Fields to fulfill the requirements for a particular type of integration.

When you click the field selector button various options are presented to allow you to configure the mapping between the external and internal field.

| Field Type                                                           | Examples                 | Field selector available value types                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| -------------------------------------------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| String, text, float, decimal, integer, date-time, and Boolean number | Acquisition Price        | <p>(Value) allows you to specify a particular value for the field. For a Boolean field the options are True and False. The way the selected value appears in the field indicates the area in which you are working, for example, {Event: Is Problem} if mapping an event field, or {Resource: Office} if mapping a Federated CMDB resource.</p><p>(Transform) allows you to define a property transform.</p><p>The multi-tier list of fields allows you to select any data field on the source using the multi-tier list of fields.</p>                                                                            |
| Profile                                                              | Manufacturer, Model Type | <p>(Value) allows you to select a pre-defined profile value for the field.</p><p>(Profile Map) allows you to map a value in a profile field to the value in a list-based field on the source.</p>                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Entity Reference                                                     | User                     | <p>(Value) allows you to select an existing ASM Core entity. In this case the field selector behaves like a standard search field.</p><p>(Search) allows you to search for an existing ASM Core entity.</p><p>(Resolution Rule) allows you to set up a resolution rule for importing or updating additional information about the entity.</p><p>(External Resource) allows you to select a field defined for the external resource. The internal field will be set to the value of the external field. This option is only available when configuring a resource mapping to integrate with the Federated CMDB.</p> |

{% hint style="info" %}
The fields that can be mapped include standard, custom, and extension fields.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.alemba.com/asm-hermes/integrate/managing-integration/setting-up-the-integration-platform/resource-mapping.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
