Consider an organization where a user logs in at 09:00 and tries to launch an app, but it fails. The user raises a ticket and escalates the issue to the administrators. The user is unable to continue with work until the issue is resolved. Isn’t this a  common problem faced by administrators face?

Imagine the failure of a critical application in an organization with ~100k users. These users will not be able to perform their tasks until the issue is resolved by the administrators, leading to a high downtime and huge loss of productivity, resources, and finally revenue. This is the price you pay for Responsive monitoring.

Now, let’s say we give you a feature with which you are proactively alerted of any failing applications, with the reason for failure, enabling you to fix the issues before the user actually launches them. You can achieve this enhanced user experience with Application Probing, our Proactive monitoring solution. Impressive, right? The Application Probing feature is available in Citrix Director Version 7.18 and later. This feature will be a shot in the arm to all administrators to assure more reliable application availability.

The Application probing feature helps you proactively monitor the health of the applications via an agent that is installed on a user’s machine. This agent launches the configured app and reports back the health of that application to Citrix Director. For more details about this feature, see the Application probing article in the Technical documentation.

How do I monitor the health of an application from Citrix Director?

A new column, Probe Result is added to the Application Analytics table. It displays the number of probes configured to run on a particular application and the status of their runs.

This information provides admins an overview of all the probes results configured across applications in a Site. Using this information, you can monitor the health of the application and identify those that have failed. When you click  the probe result it gets even better, the Application Probe Results page appears where you have powerful in-depth options to analyze the application’s health.

The probe agent breaks down an application’s launch to five stages—StoreFront reachability, StoreFront authentication, Application enumeration, ICA file download, and Application launch. This breakdown of stages provides you with a deeper understanding about the issue and helps in performing root cause analysis related to application launch failures. You also have an option to view trends of the application health for the past 7 days.

Now let us see how this feature helps in making the tasks of administrators easy. Consider the same organisation where the user logs in at 09:00. You can configure this feature to probe applications ~2 hours prior to login time. The agent probes all the configured applications and reports their health to Citrix Director where you can monitor them. Consequently, you will have sufficient time to fix the any identified issues even before any user logs in.

Do administrators need to login two hours early everyday to monitor the applications’ health?

Absolutely not! This feature has auto email alerts support which sends email notifications whenever there is an application launch failure. So the administrators need not login every day early and monitor the probe runs. Awesome, right?

The above sample email alert contains information about the application name and the failure stage which helps the administrators to start performing the root cause analysis even before access to the environment is available. Thus, the Application Probing feature decreases unnecessary wait time for the user and increases efficiency of the administrators and thereby, the productivity and revenue of the organisation.

Automating Citrix Probe Agent Installation

Consider an administrator who has to manage a large number of sites, in-order to proactively monitor the health of the applications he has to install and configure minimum one probe agent per site. This might get tedious to manually install the agent and configure them one-by-one. Now we will discuss how to use power-shell scripts to automate installation and configuration of probe agents.

Script

param (
[string]$StoreFrontUrl = $null,
[string]$StoreFrontUserName = $null,
[string]$StoreFrontPassword= $null,
[string]$DirectorUrl= $null,
[string]$DirectorUserName = $null,
[string]$DirectorPassword= $null,
[string]$ClientId= $null,
[string]$SecretKey = $null,
[string]$CustomerId= $null,
[string]$CloudEnabled= $null,
[string]$SiteId= $null,
[string]$SiteName= $null,
[string]$PathToMsi = $null,
[string]$region = $null,
[string]$configfetch = $null,
[string]$heartbeat = $null,
[string]$id = $null,
[string]$launchtimeout = $null,
[string]$pingtimeout = $null,
[string]$probeschedule = $null,
[string]$sftimeout = $null,
[string]$staging = $null
)

function WriteToPipe
{
param(
[string]$Message
)

$pipeClient = new-object System.IO.Pipes.NamedPipeClientStream('.', '2a70ffbe-3280-46e4-8e4e-5bf2feff4373', [System.IO.Pipes.PipeDirection]::InOut,
[System.IO.Pipes.PipeOptions]::None,
[System.Security.Principal.TokenImpersonationLevel]::Impersonation)

$pipeClient.Connect()

$pipeReader = new-object System.IO.StreamReader($pipeClient)
$pipeWriter = new-object System.IO.StreamWriter($pipeClient)
$pipeWriter.AutoFlush = $true
$pipeWriter.WriteLine($Message)
$returnValue = $pipeReader.ReadLine()
$pipeClient.Dispose()
return $returnValue
}

function InstallProbe
{
param(
[string]$PathToMsi
)
msiexec /i $PathToMsi /qn
}

function IsAdministrator
{
$user = [Security.Principal.WindowsIdentity]::GetCurrent();
(New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}

$isAdmin = IsAdministrator

if($isAdmin -ne $true)
{
write-host 'Run script with administrator privileges'
exit
}

if($PathToMsi)
{
write-host 'Installing Probe Agent...' -ForegroundColor 'Yellow'
InstallProbe($PathToMsi)
write-host 'Installation successfull' -ForegroundColor 'Green'
}

write-host 'Fetching config data for updation...' -ForegroundColor 'Yellow'
$configData = WriteToPipe('0{}') | ConvertFrom-Json

write-host 'Verifying if any data needs to be udpated...' -ForegroundColor 'Yellow'
if(!$StoreFrontUrl ) {$StoreFrontUrl = $configData.sfConfigData.Url }
if(!$StoreFrontUserName ) {$StoreFrontUserName = $configData.sfConfigData.UserName }
if(!$StoreFrontPassword ) {$StoreFrontPassword = $configData.sfConfigData.Password }

if(!$DirectorUrl ) {$DirectorUrl = $configData.dirConfigData.Url }
if(!$DirectorUserName ) {$DirectorUserName = $configData.dirConfigData.UserName }
if(!$DirectorPassword ) {$DirectorPassword = $configData.dirConfigData.Password }

if(!$ClientId ) {$ClientId = $configData.dirConfigData.ClientId }
if(!$SecretKey ) {$SecretKey = $configData.dirConfigData.ClientSecret }
if(!$CustomerId ) {$CustomerId = $configData.dirConfigData.CustomerId }
if(!$CloudEnabled ) {$CloudEnabled = $configData.dirConfigData.CloudEnabled }

if(!$SiteId ) {$SiteId = $configData.dirConfigData.SiteId }
if(!$SiteName ) {$SiteName = $configData.dirConfigData.SiteName }

if(!$configfetch ) {$configfetch = $configData.agentConfigData.ConfigFetchInterval }
if(!$heartbeat ) {$heartbeat = $configData.agentConfigData.HeartBeatInterval }
if(!$id ) {$id = $configData.agentConfigData.Id }
if(!$launchtimeout ) {$launchtimeout = $configData.agentConfigData.LaunchTimeOut }
if(!$pingtimeout ) {$pingtimeout = $configData.agentConfigData.PingTimeOut }
if(!$probeschedule ) {$probeschedule = $configData.agentConfigData.ProbeScheduleInterval }
if(!$sftimeout ) {$sftimeout = $configData.agentConfigData.SFTimeOut }
if(!$staging ) {$staging = $configData.agentConfigData.staging }
if(!$region ) {$staging = $configData.agentConfigData.region }

if(!$region ) {$region = $configData.agentConfigData.region }

$sfConfig = '1{"Url":"' + $StoreFrontUrl + '","UserName":"' + $StoreFrontUserName.replace("\","\\") +'","Password":"'+$StoreFrontPassword+'"}';

write-host 'Writing Storefront config data...' -ForegroundColor 'Yellow'

$result = WriteToPipe($sfConfig)

if($result -ne 'True')
{
write-host 'Writing storefront config data failed, exiting..' -ForegroundColor 'Red'
exit
}

$DirectorConfig = '2{"Domain":"","SiteName":"' + $SiteName +'","SiteId":"'+ $SiteId +'","Url":"'+ $DirectorUrl +'","UserName":"'+ $DirectorUserName.replace("\","\\") +'","Password":"'+ $DirectorPassword+'", "ClientId":"'+$ClientId+'", "ClientSecret":"'+$SecretKey+'", "CustomerId":"'+$CustomerId+'", "CloudEnabled":"'+$CloudEnabled+'"}';

write-host 'Writing Director config data...' -ForegroundColor 'Yellow'
$result = WriteToPipe($DirectorConfig)

if($result -ne 'True')
{
write-host 'Writing director config data failed, exiting..' -ForegroundColor 'Yellow'
exit
}

if($CloudEnabled -eq "1")
{
$storefrontURLdata = [System.Text.Encoding]::UTF8.GetBytes("-1")
Set-ItemProperty -Path HKLM:\SOFTWARE\WOW6432Node\Citrix\ProbeAgent\DIR -Name param1 -Value ([byte[]]($storefrontURLdata)) -Type Binary
}

$agentConfigData = '3{"ConfigFetchInterval":"' + $configfetch +'","HeartBeatInterval":"' + $heartbeat +'","Id":"' + $id +'","LaunchTimeOut":"' + $launchtimeout +'","PingTimeOut":"' + $pingtimeout +'","ProbeScheduleInterval":"' + $probeschedule +'","SFTimeOut":"' + $sftimeout +'","staging":"' + $staging +'","region":"' + $region +'"}';

write-host 'Writing Agent config data...' -ForegroundColor 'Yellow'

$result = WriteToPipe($agentConfigData)

if($result -ne 'True')
{
write-host 'Writing agent config data failed, exiting..' -ForegroundColor 'Red'
exit
}

write-host 'Sucessfully updated app probe configurations' -ForegroundColor 'Green'

What does this script do ?

This script installs and configures probe agents on a machine.

What are the arguments ?

-StoreFrontUrl 
-StoreFrontUserName 
-StoreFrontPassword 
-DirectorUrl 
-DirectorUserName 
-DirectorPassword 
-SiteId 
-SiteName 
-PathToMsi
-ClientId
-SecretKey
-CustomerId
-CloudEnabled
-Region

All the above arguments are optional so that you can update only certain elements from time to time, say passwords. Set region value to 2 for Japan cloud customer and 3 for Gov cloud customer

Sample Input

Sample Output

How do I update only certain elements ?

Sample Input

Sample Output

Notes:

  • For more information about the configuration and usage of the feature, see the Technical documentation article, Application probing
  • Citrix recommends the following combinations while configuring probe agents:
    • We recommend max 10 apps to be configured per probe endpoint per hour per site.
    • We recommend a maximum of 20 probe endpoints per site.