Use > Inventory Tools > Analysis Workbench Overview > Selecting Scan Files for Specific Computers (Complex Queries)

Selecting Scan Files for Specific Computers (Complex Queries)

Querying provides a way of selecting and reading in only those scan files for computers matching specified search criteria.

This task is carried out using the Complex Query dialog box which allows multiple search criteria to be specified from a selection of categories. These categories are defined by the hardware and asset information collected across the computer population.

When the search criteria are fully specified, the query is invoked and all scan files that match the query criteria are checked/unchecked. The Complex Query dialog box also allows defined queries to be saved so that they can be loaded and used again.

Displaying the Complex Query Dialog Box

To begin creating a query, you need to display the Complex Query dialog box used to specify the search criteria:

To display the Complex Query dialog box:

  1. Select the Load scan files command from the File menu to display the Open scan files dialog box.
  2. Right-click anywhere in the bottom list. A shortcut menu is displayed.
  3. Select the Query option. The Complex Query dialog box is displayed. By default the Queries tab is selected.

This dialog box has two tabs:

  • Queries - Displays the hardware and asset fields and allows you to build up the query.
  • Options - Sets up the logic, actions and format of the query.

The Queries Tab

The Queries tab in the Complex Query dialog box displays a page that contains the two components:

  • The available queries list
  • The query grid

The Available Queries List

There are two categories of information that can be used to query data collected from a population of computers:

  • The asset data entered manually using the asset questionnaire.
  • The hardware configuration details collected automatically for each computer as it is inventoried.

These categories of information are listed in the Available queries list on the left side of the dialog box.

Available Query Categories

These categories are used to group the items into the outline used in query and column selection. The following list shows the hardware fields that are collected during a scan:

Category Description
Asset Data Items collected manually or automatically through the entry fields in the Scanner, or items calculated using analysis-time asset fields.
CPU Data Information about the processor(s) and coprocessor of the machine.
Bus Data Information pertaining the machine's bus. This category includes the Bus architecture and a list of identified cards that are not Network cards, disk controllers or video cards.
BIOS Data Data extracted from the machine's BIOS (Which is a read-only memory area, typically located at the top of the first 1MB of memory in the machine).
Memory Data Memory information: Physical amount of memory, partitioning of memory, swap file (virtual memory) and so on.
Operating System Data Operating System information. This includes information about the OS running at the time of the scan, name, version, and so on, as well as OS services, such as user profiles, login name.
Video Data Provides details of the Video Display Adapter, which include the adapter type (EGA, XGA, VGA and so on) and model/manufacturer. In Windows and OS/2, the current desktop resolution and number of colors are also displayed.
Network Data Information about the machine's network connection. This includes a list of network cards, as well as logical information (machine name, logon name, domain name, addresses, shares and so on).
Keyboard and Mouse Data Whether a Mouse is connected. Whether a Keyboard is connected.
Disk Data Information related to physical disk drives, CD-ROM drives, network drives and so on, as well as information about logical partitioning of these. Also includes a list of disk controllers.
System Data Items specific to the scan file or scan (but, with the exception of the asset number, without real relevance to the machine itself) including asset number, scan time, time since scan, path to scan file, version of scan file and so on
Port Data Contains a list of parallel and serial ports.
Storage Data Shows the name, vendor, revision and device host information for the storage devices (such as hard drives, CD-ROMs, tape drives) that have been detected.
Peripheral Data Information about peripherals, currently modems, sound cards and printer information.
SMBIOS Information Information extracted from the machine's SMBIOS, if available.
USB Data This contains information about the USB (Universal Serial Bus) devices, controllers, hubs and ports. USB is an external bus which supports plug and play. It allows peripheral devices to be connected or disconnected from computers without the need to shut down or rebooting. These peripheral devices include CD-ROM drives, joysticks, speakers, cameras.
Machine Window Data Shows information from the Analysis Workbench Machines window.

The Query Grid

The query grid is displayed on the right side of the Queries page. Each query item is built up on a separate row. A maximum of 250 different query items are allowed.

The query grid has four columns:

  • #

    The number of the query items set up on the options page. The maximum that can be configured is 250.

  • Query

    This column is reserved for items from the Available queries list. Double-clicking on an data field in the Available queries list, moves the entry to this column of the query grid. Alternatively, you can drag the data field from the Available queries list and drop it onto a row in the query grid.

  • Operator

    Many hardware fields can be queried against a set range of values. This columns shows pick lists for the types of queries performed against the Asset fields and some hardware field values.

    • Begins with
    • Contains
    • Does not equal
    • Ends with
    • Equals
    • Greater than
    • Is not the same as another field
    • Is the same as another field
    • Less than
    • Matches
  • Condition

    This column is reserved for a parameter value that must be matched by the query.

The Shortcut Menu

  • Right-clicking on an entry in the query grid, displays a shortcut menu:
  • Edit current query - To edit an existing query entry, right-click on the cell and select this command from the shortcut menu.
  • Clear Current Line - To delete an entry from the query grid, right-click on the entry and select this command from the shortcut menu.
  • Clear All - Select this option to delete all entries from the query grid.

The Query Grid Buttons

  • Load - To use a saved query, click the Load button and select the saved query file (with a .awq extension). The query files are loaded from the Queries directory in the Universal Discovery installation path.
  • Save - To save the query for future use, click the Save button. Enter a name for the query file (with a .awq extension) and click OK. The query files are saved in the Queries directory in the Universal Discovery installation path. Saved queries can be automatically selected and used without having to define the query again.
  • Add - Highlight the desired field and click the Add button to add the definition to the query grid.

Building a Query

Queries are built within the Query grid by clicking on any + sign in the tree. This expands the relevant category and lists possible data fields.

  1. To select a data field in the Available queries list, do one of the following:

    • Double-click on a data field in the Available queries list.
    • Drag the data field and drop it onto the Query grid.
    • Select the data field and click the Add button.

    After you have done this, a Define properties for hardware query dialog box is displayed.

  2. In this dialog box select the operator for the query.
  3. Depending on the type of query you set up, enter a parameter value that must be matched by the query.
  4. Click OK. You are returned to the Complex Query dialog box.
  5. If required, you can save the query by clicking the Save button.

The Options Tab

In the Complex Query dialog box, click the Options tab.

This tab is used to do the following:

  • Retain the last query or clear the existing query.
  • Provide a description for the query.
  • Set up the actions that are to be carried before the query has been made. That is, whether to clear or set all existing tags, or to leave them untouched.
  • Set up the logic that will be used to perform the query.
  • Set up the actions that will be carried after the query has been made. That is, which tags will be applied and under what conditions.
Option Description
Caching
Remember the last query If this option is checked, a query will be retained after it has been run. If unchecked, the grid is cleared after the query has been run.
Query Description
  Allows you to enter a text description of the queries being made.
This is useful for identifying stored queries.  
Before Querying
Do not change tags No actions are performed before the query is made.
Clear existing tags All tags are cleared before the query is made. That is, all scan files are deselected.
Tag all items All entries in the Open scan file dialog box are tagged before the query is made. That is, all scan files are selected.
Query Type
Run as an OR query (at least one condition must be met) When more than one query is specified, the match is made when either one of them are true.
Run as an AND query (all conditions must be met) When more than one query is specified, the match is made when all queries are fulfilled.
  Note: Only one of these logic rules can be applied to the same query. They cannot be mixed.
Tagging
Set tag when condition is met After an entry is found that matches the parameters defined by the query, a tag is set on that entry. That is, the scan file is selected.
Clear tag when condition is met After an entry is found that matches the parameters defined by the query, if it is tagged then this tag is cleared. That is, the scan file is deselected if it was previously selected.

Example Complex Query

In this example, the query will be set up to select scan files for all machines that have a minimum specification. This may be because you want to locate all those machines that need to have their hardware and software upgraded in to be able to run a particular piece of software.

The machine that has the following minimum specifications:

  • Pentium 4 processor AND
  • 64 Mbytes or more of memory AND
  • More than 200 Mbytes of space on its local hard disks AND
  • Host operating system is Windows® XP

Step 1- Setting Query Parameters for Scan File Data

The first step for specifying the criteria for the query is to select the data items that need to be matched by the information in the scan files.

  1. In the Available queries list click on the + sign next to the CPU Data category. Click on the CPUs subcategory.
  2. Select CPU Type by double-clicking on it with the mouse or by dragging it to the grid. The Define properties for hardware query dialog box is displayed.
  3. Select is from the Operator or Query drop-down list and select Pentium 4 from the other drop-down list
  4. Click the OK button. You are returned to the Complex Query dialog box.
  5. In the Available queries list, click on the + sign next to the Memory Data category.

    Click the OK button. You are returned to the Complex Query dialog box.

  6. Select by Total Memory (Mb) double-clicking on it with the mouse or by dragging it to the grid. The Define properties for hardware query dialog box is displayed.
  7. Select >= from the Operator or Query drop-down list.
  8. Type 64 directly into the Numeric Value field, or click the calculator icon and use the keypad.
  9. Click the OK button. You are returned to the Complex Query dialog box.
  10. In the Available queries list, click on the + sign next to the Disk data category. Click on the Physical Disk Data subcategory and select Physical disk size (MB) by double-clicking on it with the mouse or by dragging it to the grid. The Define properties for hardware query dialog box is displayed.
  11. Select > from the Operator or Query drop-down list.
  12. Type 200 directly into the Numeric Value field, or click the calculator icon and use the keypad.
  13. Click the OK button. You are returned to the Complex Query dialog box.
  14. In the Available queries list, click on the + sign next to the Operating System data category.
  15. Select Host Operating System Name by double-clicking on it with the mouse or by dragging it to the grid. The Define properties for hardware query dialog box is displayed.
  16. Select the contains option from the Operator or Query drop-down lists.
  17. Type XP directly into the String Value field.
  18. Click the OK button. You are returned to the Complex Query dialog box. The final Query grid should look as follows
  19. Click Save (in the Queries tab) to save the query for future use. Enter a name for the query file (with a .sqm extension).

Step 2 - Setting the Query Options

  1. Click the Options tab.
  2. Select the Remember the last query option. This option allows any previous queries made to be saved in the grid.
  3. Enter a text description of the queries being made in the Query description box. For example, you could enter something similar to the following:

    ‘Machines meeting a minimum standard’

  4. In the Query type group, select Run as AND query. When more than one query is specified, the match is made when all queries are fulfilled.
  5. After you have specified the query parameters, return to the Queries tab and click the OK button to tag the scan files matching the query.