uberAgent

Event Triggers for Timers

uberAgent timers are configuration items that specify when and how often metrics are collected. Classic uberAgent timers operate on a fixed schedule, collecting data at static time intervals. Event triggers extend classic timers by enabling uberAgent to collect data when a specified event occurs on the endpoint, independent of the time.

Classic timers and event triggers are compatible and can be used together. You can, for example, configure a timer to run a script once when a user has logged on to a new session and continue to run the script periodically for every session on the endpoint. This ensures that information about new sessions is collected quickly after the logon and that information about older sessions is refreshed regularly. This is but one use case for event triggers. Please see below for full-featured examples.

Configuration

Event Trigger Stanza

The stanza [EventTrigger] starts a new event trigger configuration block. Please note that every event trigger must be linked to a [Timer] stanza (see the examples below).

Event triggers are configured using the following configuration settings:

Setting Description Valid Values Required
Name Specifies the name of an event trigger. This name must be linked in the [Timer] configuration. Any Yes
Type The type of event that triggers the timer. This configuration option may be used more than once per [EventTrigger] stanza if the timer should be triggered by multiple different events. Any event type from the list below. Example: UserLogon. Yes
Query The query rule to limit trigger evaluation using uAQL. Please refer to the uAQL documentation. No

Event Types

The following table lists the event types that can be used with the Type field of the [EventTrigger] stanza:

Event Type Description Platform
UserLogon This event type is triggered shortly after a user logs on to the endpoint (on average, after half the duration of the SessionDetail timer interval). Windows
SessionConnectionStateChange This event type is triggered each time a user’s session state changes. Windows
SessionRoaming This event type is triggered each time a session is roamed to another endpoint. Windows

Supported Metrics

Event Triggers for timers support the following metrics:

  • UserTags
  • CitrixSessionConfig
  • Script

Examples

Example 1: Configuration With Metric UserTags

In this example, the metric UserTags is collected through a standard timer run at a specific interval. Using the standard timer configuration, uberAgent collects the metric UserTags for all users logged on to the endpoint at the execution time. Since this metric supports the usage of event triggers, uberAgent can collect this metric upon the occurrence of a specified event for a single user instead of all logged-in users. This example shows that the metric UserTags is collected every 10000 ms and when a UserLogon event occurs.

[Timer platform=Windows]
Name              = Determine user tags
Comment           = Determine user tags
Interval          = 10000
UA metric         = UserTags
EventTrigger      = TriggerUserTags

[EventTrigger platform=Windows]
Name              = TriggerUserTags
Type              = UserLogon
<!--NeedCopy-->

Please find more examples of configuring User & Host Tags here.

Example 2: Configuration With Metric CitrixSessionConfig

This example shows a standard timer to collect the metric CitrixSessionConfig. To collect data for a single user that logs on, disconnects, or continues the session on another endpoint, all event types need to be configured within the [EventTrigger] stanza. The event trigger in this example is limited to Citrix sessions only by using the uAQL query BrokerType == "Citrix". Using this limitation ensures that the data collection is only started for Citrix remoting sessions.

[Timer platform=Windows]
Name              = Citrix session configuration details
Comment           = Collect Citrix HDX metrics
Interval          = 900000
UA metric         = CitrixSessionConfig
EventTrigger      = TriggerCitrixSessionConfig

[EventTrigger platform=Windows]
Name             = TriggerCitrixSessionConfig
Type             = UserLogon
Type             = SessionConnectionStateChange
Type             = SessionRoaming
Query            = BrokerType == "Citrix"
<!--NeedCopy-->

Example 3: Configuration With a Custom Script

This example describes a standard timer that executes a custom script at a defined interval. This timer can also be enriched with an event trigger so that the script is started on the occurrence of a particular event. In this configuration example, the script is executed in the script context UserSessionAsUser. Therefore, uberAgent executes this script additionally for a user that logs on and collects data only for this user.

[Timer platform=Windows]
Name            = CustomScriptTrigger
Comment         = Executes a custom script
Interval        = 10000
Script          = powershell.exe -executionpolicy bypass -file "C:\Program Files\vast limits\uberAgent\scripts\test-script.ps1"
ScriptContext   = UserSessionAsUser
EventTrigger    = TriggerCustomScript

[EventTrigger platform=Windows]
Name            = TriggerCustomScript
Type            = UserLogon
<!--NeedCopy-->

uAQL Properties for Event Triggers

Event Triggers can be limited in evaluation using uAQL. The following table shows the options that are available for a query.

UserLogon, SessionConnectionStateChange and SessionRoaming

The following properties are available if one of the listed events is triggered.

Property name uAQL Data Type Description
SessionId Integer The session id of the associated user.
BrokerType String The broker type. (Citrix or Microsoft or VMware or NutanixFrame or Unknown or None)
Current.ConnectionStateId Integer The system’s connection state id. This value is from WTS_CONNECTSTATE_CLASS.
Current.ClientName String Computername of the remoting client.
Current.ClientIp String IP address of the remoting client.
Previous.ConnectionStateId Integer Previous system’s connection state id. This value is from WTS_CONNECTSTATE_CLASS.
Previous.ClientName String Previous computer name of the remoting client.
Previous.ClientIp String Previous IP address of the remoting client.
Event Triggers for Timers