Creating a simple query in BMC Atrium Explorer
The following example shows how to create a simple query that searches for all computers at Calbro Services. This query includes a condition that limits the search to computers that have Calbro in their name. Finally, it creates a new category for Calbro Services in the query list.
Before you begin
As test data, create several computer system configuration items (CIs) and name them appropriately (for example, Calbro_ComputerSystem_SJ1). When you are finished, promote the CIs to the BMC Asset dataset.
To create a simple query using the Query Builder
- Open BMC Atrium Explorer.
- Click the Find tab.
- In the Find tab toolbar, click New.
- In the General Information tab, enter the following:
- In the Query Name field, type a new name for the query (for example, Computer System CIs ).
- (optional) In the Category field, type a category for the query. If you create a new category (for example, Calbro Services), it is then displayed in the Query list.
- (optional) In the Description field, type a description of the query.
- Specify if the query is shared or personal. For more information, see Shared and personal queries.
Defining General Information in Query Builder
- Click the Editor tab.
- (optional) Select the base class to use with the query.
By default, the
BMC_BaseElementclasses in the BMC Common Data Model are displayed (the following figure). You can click the Select base class down arrow to view a different set of classes. For example, select
BMC_FederatedBaseElementto view any federated classes that exist in your BMC Atrium Configuration Management Database (BMC Atrium CMDB) data model. The class list refreshes to show the subclasses of that base class.
For easier viewing, you can select a Tile, List, or Tree view of the subclasses.
- (optional) To filter the list of classes that are displayed, type a letter, word, or phrase in the Locate field.
If you type com in the Locate field, the list shrinks and only classes with com in their name are displayed (for example, Communication or Computer).
- Drag and drop a class from the list to the Drop additional classes here lane in the Query panel.
In this example, you would select the Computer System class.
The first object (Computer System) that you drag into the top lane of the Query builder is special in several different ways. It becomes the top of the query and you cannot place any items above it. This object then is a required element in the query — results are only returned from the query if it includes instances of that object.In Creating an advanced query, you add additional objects and relationships into the Query Builder.
You can add multiple objects to the top lane as long as the items in the graph are all connected. For additional information about adding objects and relationships into the Query Builder, see Creating an advanced query.
If necessary, select a class in the Query panel and then click Delete to remove it.
- To edit the class conditions, double-click the class (or select the class and then click the edit button in the toolbar).
Creating query conditions for classes
In the Conditions dialog box, use the fields and drop-down lists to create one or more conditions for that class. These conditions appear in the Find tab after you create the query.
- Click the check box to enable the query conditions.
- Type a name for the condition, such as the label of the attribute (for example,
- Select an attribute (for example,
- Select an operator (for example, LIKE or !=).
- Type a value (for example, Microsoft ).
- If you want to add another condition, select AND or OR. An additional row then appears in the Conditions dialog box.
- If you have multiple conditions, use the move up or move down buttons to arrange and group conditions to structure the query according to relational algebra formatting.
For example, you could create a class condition that queries only Dell Computers in the San Jose location (
ManufacturerName LIKE "Dell" AND Domain LIKE "San Jose"). A yellow diamond then appears next to the class, indicating that the class uses a condition.
- Click Save.
In our simple query, create a query condition that searches for all computer systems that include Calbro in their name —
Name LIKE Calbro%.
For more information about query structure, see Query structure.
- Click the Viewing Options tab to select the CI attributes for display in the query output table.
Specifying CI attributes for display in the query
- From the Configuration Items list, select a class (for example, Computer System).
- From the Attributes Selected For Display list, select all attributes to display in the query output table.
- Select attributes from all the Configuration Item classes in the list.
- Click Save to close the Query dialog box.
The new category and your new query appears in the Query list (see the following figure).
To test the results of your simple query
- In the Find tab, review the categories in the query list.
Calbro Services now appears in the list as a new category.
- Click the Calbro Services category.
- Select the Computer System CIs query and then click Search.
This simple query returns all computer systems that include Calbro in their name.
- Drag one or more CIs into the display pane to review them.
New category and query with results returned