Mapping complex queries to a class


BMC Helix CMDB has predefined complex queries that you can map to a class and also assign a priority.  Some of the predefined complex queries for incidents created by monitoring tools are mapped by default to some classes in BMC Helix CMDB. You can use the Class Query Mappings page in CMDB to modify these mappings or map additional complex queries to a class.

The use case for complex queries

When an event is created by an event monitoring system, BMC Helix Integration Service creates an incident and passes various event attributes to BMC Helix ITSM to find the CI. BMC Helix ITSM passes these queries as a REST API to CMDB. If the query is complex, the CMDB REST API uses the predefined complex queries mapped by default to classes to perform the search. The search runs at the time of incident creation, and the CI information is automatically added to the incident. For more information on the use case, see Leveraging class query mapping to associate a CI to an incident.

Before you begin

You must configure a monitoring tool to create an event that is passed on to BMC Helix Integration Service and BMC Helix ITSM to be able to associate the CI to the incident.

You must have Administrator or Reconciliation Engine Definition Author (RE Definition Author) permissions to be able to access the Class Query Mappings page in BMC Helix CMDB.

For integration with Proactive Service Resolution (PSR), you must also make the settings required for BMC Helix ITSM to run REST APIs in CMDB as described in Providing-ITSM-with-access-to-CMDB.

To map complex queries to a class

Apart from the complex queries mapped by default, you can map additional predefined complex queries to a class, or remove existing mappings.

  1. Log in to BMC Helix CMDB.
  2. Open the CMDB Class Query Mappings page.
    CIs > Class Query Mapping
  3. In the pane on the left, select a class or enter any keyword to search for a class.
    For example, to search for the class BMC_ComputerSystem, enter computer in the search field.
    image2019-11-12_12-14-31.png

    Note

    To view the existing mappings of classes to complex queries, select the View Classes with Query Mappings check box.

    image2019-12-19_9-11-52.png

  4. Select the class to view the complex queries mapped to that class.
  5. On the right-hand pane, you can click the image2019-11-5_14-55-45.png button to create a mapping.
    The query mapping options appear.
    image2019-11-12_15-51-47.png

    1. From the Category list, select the monitoring application which creates the event. 
      TSOM is the default category. You can create new categories. The category helps you differentiate queries from different sources. For example, a category called Manual can be defined for manually created incidents.
    2. In the Priority field, add an integer value that must be assigned to the query.
      When you map multiple queries to a class, this value specifies the priority of execution for that query.
    3. From the Query Name list, select all the required predefined complex queries.
      You can choose from a list of predefined complex queries. 
      image2019-11-12_15-52-47.png
  6. Click Save to map the query to the selected class.

    Note

    You can repeat the procedure to map multiple queries of different priorities to the selected class. The CI that is found from the search is automatically associated with the incident.

Example of a complex query in CMDB REST API

ITSM passes the complex query as a CMDB REST API to find the CI associated with an incident. An example of a complex query is to look for a server with the Model attribute value IBM DB2 Database Server and InstanceName attribute value db2inst1 inside a BMC_SoftwareServer class running on a computer with IP address 7x.3x.4x.2xx. The CMDB REST API refers the queries mapped to BMC_SoftwareServer class in CMDB and runs the queries mapped to the class based on the priority. The example query in CMDB REST API format has the following syntax:

/cmdb/v1.0/classqueries/BMC.CORE/BMC_SoftwareServer?attribute_values={
"BMC.CORE:BMC_ProtocolEndpoint:Address":"7x.3x.4x.2xx",
"BMC.CORE:BMC_SoftwareServer:InstanceName":"db2inst1“
"
BMC.CORE:BMC_SoftwareServer:Model":"IBM DB2 Database Server",
}&category=TSOM

For more details, see Endpoints-in-the-REST-API.

Troubleshooting issues with queries

If more than one CI matches the complex query critiera, BMC Helix CMDB returns the first CI that matches the criteria. To find other CIs that might be causing the issue, you may have to run a manual search with the search criteria. For more information on running a search, see Qualification-Builder-overview.

If the search does not find any CI, you can map additional predefined complex queries to the class.

Related topics

Use case: Automatically associating CIs related to an incident



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*