This documentation supports the 9.1 to 9.1 Service Pack 3 version and its patches of BMC Atrium Core. The documentation for version 9.1.04 and its patches is available here.

To view the latest version, select the version from the Product version menu.

Creating an advanced query in BMC Atrium Explorer

The following example shows how to create an advanced topological query that searches for all Calbro Services computers that have a required component relationship to disk drives. It assumes you already understand how to create a simple query and use conditions in your query.

Before you begin

As test data, create one DiskDrive configuration item (CI), name it Calbro_DiskDrive_1, and then create a Component relationship with one of the Calbro Computer Systems. When you are finished, promote your changes to the BMC Asset dataset.

To create an advanced query

  1. Edit the simple query that you created previously.
    (optional ) In the General Information tab, change the name of the query to Computer System and Diskdrive CIs.
  2. Click the Editor tab.
  3. Drag and drop the Diskdrive class from the Base Element CIs list to the Drop additional classes here lanes in the Query panel.
    Your advanced query can include multiple objects in multiple lanes. In this example, Computer System in the top lane is the required object in the query. By default, each item except the top item is optional.

    Creating advanced queries
  4. Create a relationship between CI classes in your query.
    For example, create a Component relationship between the Computer System and the Disk Drive CIs. Without any additional restrictions, your query would return all Computer Systems, even Computer System instances that do not have any Diskdrives. When the results are returned, you see a list of Computer System instances. However, if you view and expand the CI in the BMC Atrium Explorer display pane, you would see all the items that are included in the query, not just the top one.

    You must join all items you put in an advanced query by relationships to other items, and ultimately to the top item. You cannot join items in the same horizontal lane directly with a relationship. You should put additional connected items in a lower lane.

    To create a relationship:
    1. In the Query panel, select a class in one lane and drag your cursor to a class in another lane.
      The Relationship dialog box appears. You now can select the relationship type between the top and lower items.

      Specifying relationship between source and destination classes
    2. From the Type menu, specify the relationship type (for example, Component).
      By default, the All Related relationship type is selected. This item includes all possible relationships in the query. But you can narrow the relationship type as needed. Depending on the type you select, other options might not be available. For example, if you select Has Impact, you can specify cardinality but not conditions because the Conditions tab is disabled.

      Additional relationship options
    3. (optional) Specify the direction of the relationship.
      Typically, the top item in the query is the source and the lower item is the destination.
    4. (optional) Select the Required check box.
      By specifying that the lower item is required in each result, you restrict the CIs displayed in the query results list. For example, if Diskdrive is required, no Computer System instances are returned in the query that do not have any Diskdrives. For a relationship that joins the top item with a lower item, checking the Required check box means that the lower item is required in each result. When the query is run, no instances of the top item are returned in the results unless there is also at least one instance of the lower one.
    5. (optional) In the Required check box, specify the count restrictions in the criteria for a relationship.
      • By default, cardinality is not required. If an item is optional in the query definition, then empty parameters have no effect.
      • If you select Required for the relationship, you can also set conditions on the number of related items that must be present in order for the result to be returned.
        These numbers do not only restrict how many items are shown in the result. Consider a relationship that connected the top item to another item in a lower layer (for example, a Computer System related to a Diskdrive). The numbers specify a minimum and a maximum range of the number of lower items connected to the top item.

        Types of cardinality

        Cardinality type

        Explanation

        Unrestricted (1 to *)

        One instance of the top class is related to one or more instances of another class. This is the system default. For example, you query a computer system related to many disk drives. Your query returns computer systems with at least one disk drive.

        Restricted (2 to *)

        If you specify a minimum (2...*), one instance of a class is related to two or more instance of another class. Your query returns only those computer systems that have two or more disk drives.

        Minimum and maximum (2...4)

        If you specify a minimum and maximum (2...4), one instance of the class is related to at least two instances and up to four instances of another class. Your query returns only computer systems that have between two and four hard drives.

        One-to-one

        For a one-to-one cardinality restriction, you would select "1...1," so that the minimum and maximum are one--one instance of a class is related to a single instance of another class. For example, you query one computer system to one disk drive. Your query returns only those computer systems that have one and only one disk drive.


        In our example, the Diskdrive is a required element in the relationship. In addition, the default Unrestricted setting is used — Computer System is the top item, and the numerical condition is applied to Diskdrive, the lower item. As a result, the query returns only Computer Systems that are related to Diskdrives.

        To add additional complexity to the query, you could apply the same logic to a third item (CDROM Drive) connected to the second item (Diskdrive).

        Diskdrive is not the top item in the query, but is now considered the top item for purpose of the example (because it is directly connected to Computer System, the top item). The numerical restriction on the new relationship (between the second and third items) is a condition on how many instances of that third item are connected to each instance of the higher item. Depending on the cardinality requirements, you could construct a query that returns all computer systems that have at least one disk drive and at least one CDROM drive.

        An advanced query can include multiple items and relationships in multiple lanes.

        Finally, advanced queries can circle back in a loop to the item. But only required links are supported in a loop. If you complete the loop in the query, that final item is required. The query does not return any CIs on the attached end without that last connection.

        Multiple items in query
    6. (optional) In the Conditions tab, use the drop-down lists to create relationship conditions.

      Note

      You do not need to add conditions to most relationships.

    7. Click Save.
  5. Repeat these steps until you have added all of the classes, conditions, and relationships necessary for the advanced query.
  6. Click Save to close the Query dialog box.
    Your new advanced query appears in the Query list, under the Calbro Services category.

To test the results of your advanced query

  1. Under the Calbro Services category, select the new Computer System and Diskdrive CIs query.
  2. Click Search.
    This advanced query returns only the one Computer System that was related to the Diskdrive. Unlike the simple query you created earlier, none of the other Computer Systems are returned in the query.
  3. Drag the CI into the display pane.
    When you drag the Computer System CI into the display pane, the CI automatically expands and you see that the Computer System CI is related to a Diskdrive CI.

    New advanced query with results returned

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

Comments

  1. Srinivas Cheera

    I would like to retrieve the data of all computers in list view and attributes are CI Name, Processor, Operating System, Number of Cores., etc

    Sep 10, 2019 08:16
    1. Maithili Deshpande

      Hi Srinivas, 

      Thank you for your comment. We recommend you reach out to the BMC Support team for help on your query. 

      Regards,

      Maithili

      Sep 30, 2019 06:35