CMDB Query Builder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2023 05:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2023 06:11 AM
Hi @--oooo-- ,
A CMDB query type that queries the infrastructure for CI classes and optionally non-CMDB tables, and the relationships and references that connect them.
The Core UI plugin (com.glide.ui.ui16) must be activated.
Role required: cmdb_query_builder_read to only view and run saved queries, and cmdb_query_builder (contained for itil, itil_admin, and asset) to create and save queries, modify saved queries, and run queries.
Authorized users can update and delete a query created by another user.
Build the query by dragging the CI classes and non-CMDB tables that you want to include in the query. Then dropping them as nodes on the canvas, and defining relationship properties between them. You can filter on the attributes of any node to narrow down the results to a specific set of CIs of that class or to a single specific CI. You can also select which property columns appear in the query results.
As you step through building a query, list options and other user interface elements of the CMDB Query Builder, are dynamically filtered as appropriate to your selections.
See Sample queries for a step-by-step walk through of building CMDB queries in the CMDB Query Builder, including queries that integrate application services.
Procedure
- Navigate to All > Configuration and click CMDB Query Builder.
- On the CMDB Query Builder page do either of the following steps:
- Click Create new. Type in a Name, choose CMDB Query as the Query type, and then click Create.
- Click a widget of a saved query to continue building an existing query. Search saved queries first if needed.
- Point to the upper right corner of a saved query widget, and click the Duplicate Query icon to edit a copy of a saved query. The default name of the new query contains the string 'copy'.
- On the canvas, you can do any of the following operations:
- Add CI classes to the query: On the CMDB Classes tab, select classes from the hierarchy list and drag them to the canvas.
-
Add an Application Service CI to the query: On the CMDB Classes tab, select the Application Service class from the hierarchy list and drag it to the canvas.
In Application Service Properties on the right-side bar, you can select Convert attached nodes to pattern to query on patterns between the application service and other CMDB class nodes. When querying on a pattern, the nodes on both ends of the pattern connection, can be any number of levels apart. If Convert attached nodes to pattern is not selected, then the connection between the application service node and other CMDB class nodes, represent direct relationships.
- Add non-CMDB tables to the query: Select a table from the Non-CMDB Tables list and drag it to the canvas.
Note: A non-CMDB table cannot be the starting node in the query.
-
Add connections (relationships or patterns for application services) between two nodes on the canvas:
- On the first node in the connection, click the small square at the center of the right side.
- On the second node in the connection, click the small square at the center of the left side to create the connection.
Connection UI Notations Notation Description Full line A relationship in a CMDB query. Red asterisk at the center of the connection line Information such as relationship type is missing, invalidating the query. Levels:<n> Types:<n> or a <Reference type> notation on the connection line As applicable: The number of relationship levels and the number of relationship types included for the connection. Or, a reference type for a relationship that is a reference.
Dashed line A pattern connection between an application service node and another node. - In Connection Properties on the right-side bar, configure relationship settings (click the connection line if necessary):
- In the Relationship Direction section, select the Parent node (the Child node automatically adjusts).
- In the Relationship Levels section, set Level to First level relationships if the CIs are directly connected. Or, Up to 2nd level relationships if the CIs are connected either directly or indirectly through another CI.
-
In the Relationship Types and Related Items section, select either option:
Option Description No Relationships To query for CIs with no connecting relationships, such as All Tomcat WAR CIs which are not connected to a Windows Server
.Add Relationship Types To select specific or any relationship type. Add a Related Item To query for related CIs between the nodes.
- Configure CI reference column for a connection to a non-CMDB table: In the Connection Properties right-side bar, in the CI Reference Column section, select the column with a reference to a CI from the Use CI reference column list. If only one option is available, it is automatically selected.
- Configure the pattern between an application service node set with the Convert attached nodes to pattern option, and a non-CMDB table node: Select Apply <table> reference filter to all nodes in the pattern to apply the query to the application service CI itself and to the CIs within the application service.
- Add filters to a class node: Apply filters to narrow down a class query to a specific set of CIs or to a single specific CI.
- Point to the node to add a filter to, and then click the Apply filters icon that pops up above the node.
- In the Filters section, add attribute and related list conditions.
- Close the Filters section.
Click Applied Filters in the right-side bar to view all filters for each node on the canvas.
- Add And/Or operators to the query:
- Connect one node to two other nodes.
- Click the And box that appears on the connection line, to toggle between the And/Or operators.
All Tomcat WAR CIs which are connected either to Linux Server Or to a Windows Server
. - Add property columns for a node, to appear in the query results:
Note: For a relationship, the query results include the parent, child, and type columns. You cannot add any other columns from the [cmdb_rel_ci] table.
- Click Properties in the right-side pane.
- Click a node once or twice, so that the Report Columns section appears in the right-side bar, and then click Add Columns.
- Select properties and then click outside the properties list to close it.
- Create a combination query by integrating a Service Mapping query into a CMDB query:
- When building a CMDB query, click Saved Service Queries in the left-side bar.
- Select and then drag a Service Mapping query to the canvas.
- Add a search tag that can then be used as a search criteria for saved queries:
- Click the Add Tags icon at the top of the canvas.
- Click Add Tag and in the Query Tags dialog box enter one or more tag strings.
- Click the Add Tags icon again to close the Query Tags dialog box.
- Click Save.
On the Saved Queries tab, point to a saved query widget and click Query Information. Query details such as the query type, last update date, CMDB groups associated with the query, and the query schedules appear.
What to do next
-
Click Run.
Only the first 100 results of the query appear in the results pane.- Click Load More Results to view the next set of 100 results.
- Click Load All Results to view the rest of the query results, up to the number specified by the glide.cmdb.query.max_results_limit system property (10,000 by default).
Click a CI to open its CI form, and on the CI form click Dashboard to view CI health in the CI dashboard.
Note:- Ensure that the glide.security.use_csrf_token property is set to true, allowing all results to appear.
- When Level is set to Up to 2nd level relationships, the relationship type does not appear in the query results.
- When a query is running, wait for it to complete or to time out before opening or running another query.
- Modify Query Builder settings: Click the
- Copy and share the URL of a saved query with users that have access to the CMDB Query Builder. Pasting the shared URL in a new internet browser window, directly opens the saved query in the CMDB Query Builder.
- Create reports in CMDB Query Builder.
- Create a schedule to run the query at a future time, and to email the results to interested parties.
- Export query results:
Click the Query Results context menu and select Export. Even if the Load More Results button is visible, indicating that there are additional query results, only the results that are visible are exported.
- Export and import a CMDB query to port a query definition between instances.
- Populate a CMDB group using a saved query.
- Delete a CMDB query.
Also, refer to this video : https://www.youtube.com/watch?v=NArqszOamHc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2023 06:51 AM
@Community Alums, I am not able to see add relationship type option in the cmdb query builder .please guide me why I am not able to see that option.
thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2024 01:00 PM
@Sandeep Dutta , Quick Question on this , on the query builder when I check any saved query and do nothing the Query builder asks me to Save the query even if I did nothing on the query , just loaded on the canvas , is this expected behaviors