Skip to main content

Demystifying Inventory Queries

Description

Inventory queries are fundamental, both for reporting and Fileset deployment.  For basic details for queries, please take a look at Creating and Editing a query

However, if the query isn't correct, then you could end up with incorrect reports or worse still incorrect Fileset deployments or removals.

Information

So as well as the above section of the guide, additionally there are some example queries built into the Admin console: What are Sample Queries?

Sometimes though, you need that something that is a little more complex or you can't quite get the right results.  Some considerationconsiderations when making queries:

  • Do you need the query
  • Does the criteria match the desired expectation
  • What Main Component should be used
  • What Fields do you really need present

Following are some examples to demonstrate this.

  1. Devices that do not have an application installed
  2. Unexpected Entries
  3. None and Not

1) Devices that do not have an application installed

Do you need the query?

SeemsThis seems like an odd question, but why is this required?  If Filesets are associated they should be installed, if not already, at the next check check-in from the device.  If the software has failed, then this is already available through the Report window.  Perhaps they aren't in the right groups to be associated though or maybe the device hasn't checked in for a long time.  Creating a Smart Group based upon an application that is not installed though, will not change the installation status if there is already an association and the App has failed to instal.install.

Does the criteria match the desired expectation?

In this casecase, we want the devices that do not have an application installed.  Using Firefox on macOS as an Example.

Drag in 'Application' > 'Name' to the criteria and set the following:

  • Application/Name
  • Is
  • Firefox.App

Note we have 'Is' selected.  Selecting 'Is Not,Not', 'Does Not Contain,Contain', etc will not yield the desired results.  Selecting 'Is NotNot' for instance, will list all devices that have any application on those devices that isare not called Firefox.App.app.  In essenceessence, this will be all devices, those with and those without Firefox.  InsteadInstead, we tick the Not box.

By using the Not box, it gives the reverse of the query.  List all the devices that have Firefox and then give the opposite result (based uponon the Main Component, which will be covered next).

Since this is a MacOS query, then additionally the OS Type can be added:

  • OS Type
  • Is
  • macOS

FirefoxMissingQueryCriteria.pngFirefoxMissingQueryCriteria.png

What Main Component should be used?

The main component is the key ingredient that the criteria will be based upon.  Imagine two fields: FileWave Client Name and Application > Name

With the main component set to Application, the query will be:

  • Show all Applications that are not Firefox.Appapp

A query set up this way will therefore show all devices, as any App that is not Firefox.Appapp will be a successful hit on this search

FirefoxQueryMainComponentApplication.pngFirefoxQueryMainComponentApplication.png

With the main component set to macOS/Windows Device, then the query will be:

  • Show all devices that do not have Firefox.Appapp

This will be a different set of results, as now any device that has Firefox installed will no longer show.  This is the desired result.

FirefoxQueryMainComponentmacOS.pngFirefoxQueryMainComponentmacOS.png

What Fields do you really need present?

The above has given the desired result, but there are multiple entries per device.  From a Smart Group associationsassociation point of view, strictly speakingspeaking, this should not matter.  There is only one of each device in reality, but it makes it hard to read and does not work well as an Inventory Query for reporting.  As such, removing any relationship that will create a 1:many relationship would be ideal, such that there is only one result per device.

FirefoxQueryClientNameOnly.pngFirefoxQueryClientNameOnly.png

2) Unexpected Entries

Sometimes there aresome entries that seem unexpected.  This is usually related to one of the query items in the last example not being set as actually expected.  From the last example, changing the Main Component to Application will still have an undesired result, as this will be searching the criteria against Application entries in the database even though that Field is not shown.  There will still only be one entry visible per device, but the search is now listing all Applications that are not Firefox, so every device.

FirefoxQueryClientNameOnlyByApplication.pngFirefoxQueryClientNameOnlyByApplication.png

It is possible though, that with an incorrect Main Component and certain fields added, the output can appear confusing.  Start with a fresh Inventory query and by setting the following, many entries can be seen with no FileWave Client Name:

  • No Criteria
  • Add FileWave Client Name as a Field
  • Add Operating System as a Field (by dragging this in, all sub sub-inventory items for Operating System will be added to the Fields view).

With the Main Component set as Operating System, there will be many entries with no FileWave Client Name.

AllOSInfoQuery.pngAllOSInfoQuery.png

This will be because entries have been made into the database from machines running these OS versions that are no longer appropriate for any of the active devices.  Again, by changingChanging the Main Component, thisComponent can provide a true representation of the current installed OS versions.

AllOSInfoQueryMainComponentmacOS.pngAllOSInfoQueryMainComponentmacOS.png

Saving the above with the Main Component set as Operating System these entries can be seen to have no client.  Right Right-click on an entry.  As well as Copy, is there the option to Reveal Client:

InventoryQueryRevealClient.pngInventoryQueryRevealClient.png

InventoryQueryCopyName.pngInventoryQueryCopyName.png

If there is no Client to Reveal, then there is no representable entry in the database.  If you have a FileWave Client Name that shows,shows but does not have the option to Reveal Client, it may be an old static record whichthat will require manual removal.  In this instanceinstance, you could contact support and they would be able to assist in tidying this up.

Inventory Only and Archived Clients
When attempting to Reveal Clients, if the client is either Inventory Only or Archived, the relevant option to view these would need to be set through the contextual Menu Item

3) None and Not

Not can in many instances be more useful.  A question was posed:

"We would like an Inventory query to show devices that have multiple specific Filesets installed?installed. The issue I am seeing is that if you try to enter multiple Fileset IDs to an inventory query it will show no results because I am guessing it is trying to look for every Fileset to have multiple IDs. So basically I want to find a device that has Fileset 1, 2, and 3, installed and they must have all 3 to go in tointo the query."

Taking from the information above, the negative logic will be seen to be the approach.  Trying to search for each of these using positive logic will again not yield the correct results.  Instead, Not can be used with desired results when mixed with None.

InventoryQueryNoneNot.pngInventoryQueryNoneNot.png

Take some time to think about how this works.  Understanding of this will make Inventory Query building in general more successful and ensure you don't have unexpected results.