Jump to content
Updated Privacy Statement
  • 0

Log ICA RTT and ICA latency in Director or via Powershell


JBO

Question

Is there a way to log the ICA-RTT and ICA-Latency for the User Sessions?

I've got a Customer that is complaining for bad Performance in the Sessions from time to time.

Every Time i have a look there is no Problem and everything they tell me points to high Latency Sessions.

There for i would like to log the Latency every couple of seconds.

 

Link to comment

2 answers to this question

Recommended Posts

  • 0

Hi,

you have to execute WMI query on every VDA.

e.g. 

# modify ctxbroker, vdaserver, domain...


$log_ctx_icartt="c:\temp\ctxicartt.log"
$ctxbroker="serverddcbroker.domain.net"
$ctx_all_sessions=Get-BrokerSession -AdminAddress $ctxbroker -MaxRecordCount 800
#nur LAN user
$ctx_all_sessions | where {$_.ReceiverName -notlike 'WR_*' -and $_.SessionState -eq 'Active'}
$ctx_connected_SiteX=$ctx_connected | Where-Object {$_.machinename -like '*vdaserver*'}

$counterUser=0
$ICARTTsum=0
$ICARTTavg=0
foreach ($user in $ctx_connected_SiteX) {
    $rdpsession=Get-RemoteRdpSession -computer $($user.dnsname) -state ACTIVE
    foreach ($session in $rdpsession) {
        if ($session.username -eq ($user.username).ToLower().Replace('domain\','')) {
            $ctxwmidetails=Get-WmiObject -ComputerName $($user.dnsname) -Credential $cred -Namespace root\Citrix\euem -Query "select * from Citrix_Euem_RoundTrip where sessionid=$($session.state)" | select SessionID,RoundtripTime,NetworkLatency
            $counterUser++
            $ICARTTsum=$ICARTTsum + $($ctxwmidetails.RoundtripTime)
            Write-Output "- wmi: $($session.computername) $($session.username) $($session.state) $($ctxwmidetails.sessionid) $($ctxwmidetails.RoundtripTime) $($ctxwmidetails.NetworkLatency)"
        } # end if user = user...
    } # end foreach $session in $rdpsession
} #end foreach user in ctx LAN connected
if ($ICARTTsum -eq 0) { $ICARTTsum=0 } else { $ICARTTavg=[math]::round($ICARTTsum/$counterUser) }
$ICARTTavg | Out-File -Encoding ASCII -append $log_ctx_icartt

 

Link to comment
  • 0

You can also get this data from Citrix Director - you can find ICA RTT (fetched every 5 mins) in UI when analyzing a session; see: https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/director/site-analytics.html#monitor-sessions. IcaRttMS is available in SessionMetrics table for last hour - as shown in image below. You can find schema details here:  https://developer-docs.citrix.com/projects/monitor-service-odata-api/en/latest/api-schema.pdf 

image.thumb.png.954c636488bb0acd4f645c9fc22d5740.png

You can query the SessionMetrics table using OData API or providing OData query in Director/Monitor UI (in Trends > Custom Report). Below is a sample OData v3 query you can use in Custom Reports in Director/Monitor UI - to get ICA RTT for user called Alfreds in time specified.
 

SessionMetrics?$filter = CreatedDate ge datetime'2022-12-15T04:53:51' and CreatedDate le datetime'2022-12-15T06:53:51' and substringof('Alfreds', Session/User/UserName ) eq true & $select=IcaRttMS&$expand = Session,Session/User

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...