This documentation supports the 20.02 version of BMC CMDB.

To view an earlier version, select the version from the Product version menu.

Creating a graph query to search for a CI

You can create a search query by using the graphical query builder, save the query, edit the query, and use it to search for CIs.

Example

Jonnie, a system administrator in Calbro Services wants to install patch 2.0 of an antivirus software on computers belonging to the Payroll department. He creates a query that looks up for all computers that have the antivirus software installed on them, but not having the patch 2.0 of the software installed on them.

He can reuse this query later on by editing the patch details to install another patch on the same computers. He can also share this query with system administrators of other departments. They can edit the computer system class details to install this patch on computers in their department. 

This query includes the BMC_ComputerSystem CI class, the BMC_Component relationship class, the BMC_Application class, and the BMC_Patch class.

For each class, Jonnie can create one or more query conditions based on the attributes of that class. For example, a query for computer systems might include several conditions for the BMC_ComputerSystem class ( NameDepartment attributes) and other conditions for the BMC_Patch class ( PatchNumber attribute)..


To create a graph query to search for a CI

  1. In the CMDB Dashboard UI, select New Query from the list of search queries. 

    The New Query window is displayed.

  2. Drag and drop classes into the right pane.


  3. Add relationships between those classes in accordance with the query qualifications. 
    To add a relationship, click the triangular icon below the source class. 
    Move your mouse and extend the arrow from the source class to the destination class, and click the destination class.



    The Select relationship between classes dialog box is displayed.


  4. Select the relation type between the source and destination classes. 
    Only valid relationship types are available for selection in the list.

  5. Specify the cardinality information:
    By default, the Required check box is selected. 
    In this example, the query returns results only if a computer system has an application running on it. 

    1. (Optional) Select the Minimum value. 
      By default, the minimum value is 1. 
      You can change it to any other value.

    2. (Optional) Select the Maximum value.
      The default value is '*' (unrestricted). 
      Select the Specify Value check box and specify a maximum value. 
      For example, if you specify the minimum value as 2 and maximum value as 4, the query returns computer systems that have at least two applications and up to four applications running on them.
      For more information on Cardinality, see Cardinality.

    3. (Optional) To set the impact direction for the relationship, turn on the Set Impact toggle key and select an impact direction.
    4. Save the details.
  6. (Optional) You can include additional qualifications for a class by clicking Edit Class Qualification 
    In this example, for a computer system class, you must include a qualification that assigns a Payroll value to the Department attribute. 


    The Qualification Builder opens. 


    Use the qualification builder to add a qualification. 
    For more information, see Qualification Builder overview

  7. Repeat steps 2 to 10 to add the remaining classes and create relationships. In this example, you must add the Patch class.
    The complete query is shown in the following figure.


  8. When you finish creating the query, test your query by clicking Validate and search.
    Validate and search is enabled only after you create a relationship between at least two classes. 
    If the search results do not provide any results, you can change the dataset on which you are searching.



  9. Specify a category under which you want to save the query, a name and a description for the query.

  10. (Optional)To save the query as a personal query, turn on the Is Personal  toggle key.
    By default, the query is saved as a shared query.



  11. To save the changes, click Save query.




To create a search query with optional query definition

While creating a search query, if you clear the Required checkbox, the cardinality is not considered, which makes query definition as optional.

In this example, if you specify the cardinality as not required between the application class and patch class, the query returns all computer systems that have any application running on them, irrespective of whether a patch is installed on them or not.
However, it does not return that computer system that has patch 2 installed on them. A sample query result is shown in the following figure:


The following video (5.05 min) shows you how you can create search queries to search for CIs in BMC CMDB:

 https://youtu.be/crMAaof7zwE


Editing a search query 

You can edit a search query at any time to include any changes.

To edit a search query

  1. From the Quick Search drop down list on the CMDB Dashboard, select the query that you want to edit.


  2. (Optional) To edit a relationship, click Edit  for the relationship. 
    The Select relationship between classes dialog box opens. 
    You can select a relationship or change the cardinality and save the changes.
  3. (Optional) To add a qualification or edit a qualification for a class or for the relationship, click Edit class qualification  .
    For example, if you have added an impact direction to a relationship earlier, but you want to change the relationship now, you cannot change it using the Select relationship between classes dialog box. You must change the impact direction from the qualification builder as shown in the following figure.


  4. (Optional) To change the class from which you want the search query to return results, click Return CIs from class  for that class (CI). 
    For example, if the BMC_ComputerSystem class is selected then the search result returns CIs from that class if present in the dataset on which this query is run.



  5. After making the changes, click Validate and search.
    You have an option to update the details of the query and save it, or save a copy of the query.


    1. If you click Update, the existing query details are updated with the changes that you have made.
    2. If you click Save copy, a copy of the query is created with the changes that you have made.
       

    Page not found for multiexcerpt macro.
The page: .Searching and viewing CIs and relationships in CMDB Explorer v21.02 was not found. Please check/update the page name used in the 'multiexcerpt-include' macro.


Accessing search queries that were created in Atrium Core Console from the CMDB UI

Search queries that are created in the Atrium Core Console can be viewed and edited in the graphical query builder but all the features of that query cannot be used in the CMDB UI. For example, you can create queries with parameters, bidirectional queries, or queries with folding rules in the Atrium Core Console, but after you open these queries in the graphical query builder and save the query, the query is saved in the new format. Queries with parameters, bidirectional queries, and queries with folding rules are not supported in the CMDB UI. These queries may not return the desired results. 

Create a loop in a search query

While creating a query, you cannot connect a parent class to a child class and then create another relationship between the child class and the parent class. If you try to create a loop, an error is displayed as shown in the following figure: 




Was this page helpful? Yes No Submitting... Thank you

Comments