Sample queries

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 5 minutes to read
  • Use the following sample queries to build your own CMDB queries and Service Mapping queries.

    Using the CMDB Query Builder requires that the Core UI plugin (com.glide.ui.ui16) is activated.

    CMDB query sample

    Use this example to build a CMDB query to find all servers with a connection to a database.

    Before you begin

    Role required: none

    Example

    1. Navigate to All > Configuration > CMDB Query Builder.
    2. Click Create new. Enter a Name - All servers with a connection to a DB. Choose CMDB Query, and click Create.
    3. In the CMDB Classes list, locate the Server class, and drag it to the canvas.
    4. Locate the Database class, and place it to the right of the Server class node on the canvas.
    5. Click at the center of the right side of Server, and then at the center of the left side of Database to create a connection line between the two class nodes.
    6. Click once or twice on the connection line until the Connection Properties panel appears in the sidebar. In the Relationship Types and Related Items section, click Add Relationship Types and add all the relationships from the list.

      Connecting the Server and the Database nodes and adding relationship types.

      Settings in the Relationship Direction section reflect the parent-child direction in the relationship. If the Database class is the parent in the relationship, then the Parent and Child settings are switched.

    7. Click Save, and then click Saved Queries on the left to see the widget for the saved query.
    8. Click the query widget to return to the canvas in edit mode.
    9. Click Run to execute the query.

      Review the query results. Each row displays the name of a server CI, the name of a database CI, and the relationship type between them.

    10. Add columns to the query results:
      1. Click the Server 1 node on the canvas once or twice so that the Server 1 Report Columns section appears in the right-side pane. Click Add Columns.
      2. Select Manufacturer and then click outside the columns list to close it.
      3. Click Run.

        Review the query results which now include the Manufacturer column.

      4. Click Save again to save all your customization for this query.

    CMDB query sample - Application service 1

    Use this example to build a CMDB query to find all critical application services, and their owner.

    Before you begin

    Role required: none

    Example

    1. Navigate to All > Configuration > CMDB Query Builder.
    2. Click Create new.
    3. Enter All critical application services as the query Name. Choose CMDB Query and then click Create.
    4. In the CMDB Classes list, locate the Application Service class, and then drag it to the canvas.
    5. Add a filter to the application service node:
      1. Point to the application service node, and then click the Apply filters icon that appear.
      2. In the Filters section, add the condition [business criticality] [is] [1 - most critical].
      3. Close the Filters section.
    6. Add columns to the query results:
      1. In the Properties right-side bar, click Add Columns.
      2. Select business criticality and owned by, and then click outside the columns list to close it.
    7. Click Save.
    8. Click Run and then review the results. You can for example, locate any of the critical application services without an owner.

    CMDB query sample - Application service 2

    Use this example to build a CMDB query to find all application services, for which there is an incident or a change request, for either, the application service itself, or any CI within the service.

    Before you begin

    Role required: none

    Example

    1. Navigate to All > Configuration > CMDB Query Builder.
    2. Click Create new.
    3. Enter Application services with incidents or change requests as the query Name. Choose CMDB Query and then click Create.
    4. In the CMDB Classes list, locate the Application Service class and then drag it to the canvas.
    5. Click Non-CMDB Tables.
    6. Locate the Incidents class in the class hierarchy, and then drag it to the canvas.
    7. Locate the Change Requests class in the class hierarchy, and then drag it to the canvas.
    8. Connect the Application Service and the Incidents nodes, and then, in the Properties right-side bar:
      1. Select Apply Incidents reference filter to all nodes in the pattern.
      2. Set Use CI reference column to Configuration item.
    9. Connect the Application Service and the Change Request node, and then, in the Properties right-side bar:
      1. Select Apply Change Request reference filter to all nodes in the pattern.
      2. Set Use CI reference column to Configuration item.
    10. Click the And operator between the Incidents and the Change Request nodes, and switch it to Or.
    11. Click Save.
    12. Click Run and then review the results.

    CMDB query sample - Application service 3

    Use this example to build a CMDB query to find all hardware in my service offering that has Windows installed.

    Before you begin

    Role required: none

    Example

    1. Navigate to All > Configuration > CMDB Query Builder.
    2. Click Create new.
    3. Enter All hardware in my service offering that has Windows installed as the query Name. Choose CMDB Query and then click Create.
    4. In the CMDB Classes list, locate the following classes, and then drag them to the canvas.
      • Service
      • Service Offering
      • Application Service
      • Searching for infrastructure, Hardware
    5. Connect the Service node to the Service Offering node.

      In the Properties right-side bar, click Add Relationship Type and select the Connect to::Connected by relationship.

    6. Connect the Serviced Offering node to the Application Service node.

      In the Properties right-side bar, click Add Relationship Type and select the Connect to::Connected by relationship.

    7. Click the Application Service node.

      In the Properties right-side bar, select Convert attached nodes to pattern to include all CIs within the application service, in the query.

    8. Connect the Application Service node to the Hardware node.
    9. All infrastructure under Service,
    10. Click Save.
    11. Click Run and then review the results.

      You can click Column options of the Service column header, and select to Group by Service. Then expand a service to see all the hardware infrastructure under that service.

    12. Return to the CMDB Query Builder window, to expand the query to include only infrastructure CIs on which Windows is installed.
    13. Click Non-CMDB Tables, locate the Software Instance class, and drag it to the canvas.
    14. Connect the Hardware node to the Software Instance node.

      In the Properties right-side bar, set Use CI reference column to Installed on.

    15. Point to the Software Instance node, and click on the Apply filters icon that appears. In the Filters section, add the condition [Product Name.Name] [is] [windows]. Close the Filters section.
    16. Click Save.
    17. Click Run and review the new results.

    Service Mapping query sample

    Use this example to build a Service Mapping query to find all Linux servers in services.

    Before you begin

    Role required: none

    Example

    1. Navigate to All > Configuration and click CMDB Query Builder
    2. Click Create new. Enter a Name - Linux server in services. Choose Service Mapping Query, and click Create.
    3. In the CMDB Classes hierarchy list, locate Linux Server and drag it to the canvas.
    4. Click Run.

      Review the query results. Each row displays the name of a Service Mapping Service and the name of a Linux Server that is a member of that service.

    5. On the right-side pane, click Disable Service Including This Pattern and then click Run again.

      Review the query results. Now, each row displays the name of a Service Mapping Service that does not include the specified Linux Server.