Queries are customized searches of core databases. This product
provides tools that let you create database queries for devices in
your core database, as well as a method for you to create LDAP
queries for devices located in other directories. You create core
database queries in the console's Query view. You create
LDAP queries with the Directory manager tool.
Queries help you manage your network by allowing you to search
for and organize devices in the core database based on specific
system or user criteria.
For example, you can create and run a query that captures only
devices with a processor clock speed of less than 2 GHz, or with
less than 1 GB of RAM, or with a hard drive of less than 80 GB.
Create one or more query statements that represent those conditions
and relate statements to each other using standard logical
operators. When the queries are run, you can print the results of
the query, and access and manage the matching devices.
Creating database queries
Use the New query dialog to build a query by selecting
from attributes, relational operators, and attribute values. Build
a query statement by choosing an inventory attribute and relating
it to an acceptable value. Logically relate the query statements to
each other to ensure they're evaluated as a group before relating
them to other statements or groups.
To create a database query
In the left navigation pane, click
Reporting > Queries, then click New on the
toolbar.
Select a component from the inventory attributes
list.
Under Step 1: Search conditions, click
Edit.
Drill down this list to select the attributes that
will be your search condition. For example, to locate all clients
running a particular type of software, you would select
Computer.Software.Package.Name.
After selecting the attributes, you'll notice that a
series of fields appear in the right side of the window. From these
fields, select an operator and value to complete the search
condition. For example, to locate all clients running Internet
Explorer 6.0, the attributes would be
"Computer.Software.Package.Name," the operator "=," and the value
"Internet Explorer 6."
At the bottom of the window, click Add to fill
in the empty field with your search condition.
You can continue to refine the query by creating
another search condition, then adding it to the first with a
boolean operator (AND or OR) . Also use the buttons to add, delete,
replace, group, or ungroup the conditions you create.
When you're finished, click OK.
Under Step 2: Attributes to display, click
Edit.
Drill down this list to select an attribute to
display in the query results list. Remember to select attributes
that will help you identify the clients returned in the query.
NOTE: If you're using
an Oracle database, make sure you select at least one attribute
that is natively defined by the inventory scanner (for example,
Computer.Display Name, Computer.Device Name, Computer.Device ID,
Computer.Login Name, and so on).
After you've selected an attribute, click Add
to move it into the empty field on the bottom of the window. If you
want to enumerate your query results list, click Include
count.
Repeat the process if you want to add more
attributes. Use the Remove button to remove attributes, and
click Move up or Move down to change the order of
attributes.
Click Make results targetable to enable the
results of the query to be targetable for any actions you
specify.
When you're finished, click OK.
(optional) Under Step 3: Sort results by
attribute, click Edit to customize the order of query
results.
If you want to run the query additional times, click
Save query, and enter a unique name for the query. If you
run the query prior to saving it, the query parameters are lost and
must be reconstructed to run the same query again.
Under Step 4: Run query, click Run
query.
Query statements are executed in the order shown
If no groupings are made, the query statements listed in this
dialog are executed in order from the bottom up. Be sure to group
related query items so they're evaluated as a group; otherwise, the
results of your query may be different than you expect.
Running queries
To run a query
In the left navigation pane, click Reporting >
Queries.
Select the query and click Run. If you want to
make changes to the query before running it, click the query, click
Edit, modify steps 1-3, and then click Run query.
NOTE:Note: If
you have modified the query and want to save your changes, click
Save query to save the changes or Save query as to
give the modified query a new name. Do this before running the
query. If you do not save your changes before running the query,
the changes will not be saved with the query.
The results (matching devices) display in the
right-hand pane of the All devices view.
To save the results as a comma-separated value file,
click the Save as CSV button on the toolbar. To print the
results, click the Print view button.