Sample CMDB queries

Use the following sample queries to build your own CMDB queries.

CMDB query sample

Use this example to build a CMDB query.

All servers with a connection to a database

  1. Navigate to Configuration and click 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 Artifacts 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.
  6. In the Connection Properties dialog, in the Add Relations for Server 1 section – one by one, select all the listed relationships.

    Note that the added relationships are displayed in the navigation bar on the right, underneath Server 1.

  7. Click Save, and then click Saved Queries on the left to see the tile for the saved query.
  8. Click the query tile 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 Server 1 on the canvas.
    2. On the right navigation bar, underneath Server 1 Report Columns, click Add Columns.
    3. Select Manufacturer.
    4. Click Run.

      Review the query results which now include the Manufacturer column.

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

Service Mapping query sample

Use this example to build a Service Mapping query.

Linux server in services

Note: To build and run a Service Mapping query, Service Mapping must be activated.
  1. Navigate to 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 Artifacts, 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 navigation bar, click Disable Service Including This Pattern, and then click Run again.

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