NAV

Machine Query Filtering

SimpleHelp 5.4 introduces a new way to filter machines in the Access tab. This guide explains how to create a Machine Query Filter, and what attributes you can include in your filters.

Creating a Machine Query Filter

In the Access tab of the Technician Console begin by using the search field to filter the list of machines:

Search Field Screenshot

In SimpleHelp 5.4 there are now two different search modes:

X X
Text Based Search Text Search - text you type into the search field will be used to decide whether machines are included based on if the text entered is included in the machine's details.
Language Based Search Query Search - specify a search query that will be evaluated on each machine to decide whether it should be included or not.

Selecting the Query Search option exposes the query field.

Query Structure

A Machine Query include three core components: - Machine Variables - these take the form of text, such as os, name or hostname and represent machine-specific information that is substituted into the query when it is evaluated against a particular machine. - Values - these might be text such as "Windows" or a number such as 10. - Operators - these allow us to compare variables and values and include = (equals) and contains.

Variables

SimpleHelp 5.4 includes the following variables that can be used in your queries:

X X
alertsTriggeredCount The number of alerts that are currently triggered on this machine
build The build version of this service.
canScript true if this machine permits remote tool and script execution.
canMonitor true if this machine permits monitoring.
daysSinceLastOnline The number of days since this machine last registered.
domain The Windows domain name of the remote machine.
fullName The full name for this remote access machine, including any groups, like GroupA/GroupB/Name.
group The group that this machine is in.
groups The group hierarchy that leads to this machine, like GroupA/GroupB.
hostname The hostname of the remote machine.
id The machine's unique ID within the SimpleHelp server.
inUse true if this machine is currently in use by the remote user, or another session is connected.
ips The set of local IP addresses, comma separated.
is64bit true if this machine's operating system is 64 bit.
lastInUse The time, in milliseconds, that this machine was last in use.
lastPing The time, in milliseconds, when this machine last registered with the SimpleHelp server.
loadAverage1 The one minute CPU load average on the remote machine.
loadAverage5 The five minute CPU load average on the remote machine.
loadAverage15 The fifteen minute CPU load average on the remote machine.
monitoring true if this machine is currently set to monitor.
name The name of the Remote Access Service.
notes Notes associated with this service.
os The remote machine's operating system.
problemCount The number of issues that this service is experiencing. Issues are shown in the Access tab.
properties The machine's properties, as a sequence of key=value,key2=value pairs.
protocol The protocol that this service is using to register (udp, http, https).
rdpCount The number of RDP sessions on the remote machine.
rdpSessions Details of the RDP sessions on the remote machine.
remoteWork true if the machine can be used for Remote Work purposes.
sessionCount The number of SimpleHelp sessions to the remote machine.
state On of offline, restart, upgrade or online.
tagCount The number of tags associated with the remote machine.
tags The set of tags, comma separated, associated with the remote machine.
user The username of the remote logged in user.
version The service version, such as 5.3, 5.4 etc.
wan The WAN IP address of the remote machine.
warnings The warning text currently associated with this remote machine.
workgroup The Windows workgroup that the remote machine is in.

Operators

The following operators can be used to combine variables and values:

X X
= Compare two values to check if they are equal, such as sessionCount = 1.
!= Compare two values to check if they are not equal, such as sessionCount != 0.
AND Evaluates to true if both values are true, such as inUse AND (sessionCount = 0).
OR Evaluates to true if either value is true, such as canMonitor OR canScript.
< Evaluates to true if the first value is less than the second, such as sessionCount < 2.
> Evaluates to true if the first value is greater than the second, such as sessionCount > 2.
<= Evaluates to true if the first value is less than or equal to the second, such as sessionCount <= 2.
>= Evaluates to true if the first value is greater than or equal to the second, such as sessionCount >= 2.
contains Evaluates to true if the first value is text that contains the second value, such as os contains "Windows".
!contains Evaluates to true if the first value is text that does not contain the second value, such as os !contains "Windows".
! A negation operator that evaluates to true if the value following the operating is false, such as !inUse.

Values

Values in queries are fixed terms and can take on one of the following forms:

X X
Text Text in a query must be wrapped in single or double quotes, such as "Windows" or 'Linux'
Numbers Numerical values, such as 10 or 12.5.
true or false Truth values, either true or false.

Query Help

Since queries must take a specific form, SimpleHelp includes inline help to help you write your queries. To expose the inline help panel press the ? button. The panel will appear beside the machine list, as shown below.

Search Field Help Screenshot

For Variables, the help user interface will update depending on the machine that you have selected in the Access tab, to reflect that machines variable value. This is a convenient way to easily see what the form of different variables are.

Example Queries

os contains "Windows"

  • Filter the list of machines, and only include machines that have the text Windows in their operating system variable.

os !contains "Windows"

  • Filter the list of machines and include any machine that has an operating system variable that does not include the text Windows.

(os contains "Windows") AND (os !contains "20H1")

  • Include all Windows operating system machines, except those versioned with 20H1.

daysSinceLastOnline > 365

  • Only include machines that have not registered in the last 365 days.

wan = 200.100.201.101

  • Only include machines that have a WAN IP address of 200.100.201.101.

!inUse AND (state = "restart")

  • Show machines that are not currently in use, and require a restart to upgrade.