BIG-IP v11 Citrix XenApp Monitor

Problem this snippet solves:

This TMSH script quickly and easily creates a monitor for Citrix XenApp on an LTM BIG-IP V11. Instructions for importing and executing this TMSH script are found in the F5 deployment guide. The script takes three inputs, username, password and appname and then automatically calculates the POST Content-Length to create a customized, specialized monitor for your Citrix environment.

Code :

proc script::help { } {
    tmsh::add_help "Create a monitor for Citrix XenApp version 5.x \n\

proc script::run { } {
    if { $tmsh::argc < 4 } {
       puts "Requires four arguments:      you have not supplied via the command line. Switching to Interactive Mode."
       set username [getFeedback "What is the username " "g.washington"]
       set password [getFeedback "What is the password?" "password"]
       set appname [getFeedback "What is the appname?" "notepad"]
       set domain [getFeedback "What is the domain name?" "corpdomain"]

   if { $tmsh::argc == 5 } {
       set username [lindex $tmsh::argv 1]
       set password [lindex $tmsh::argv 2]
       set appname [lindex $tmsh::argv 3]
       set domain [lindex $tmsh::argv 4]


    set postcontent "permissionsallica30content$username$password$domain$appname-CitrixXMLBroker0.0.0.0" 

   set length [string length $postcontent]
   set escapes [regexp -all {\B} $postcontent]
   set contentlength [expr [string length $postcontent] - $escapes ]

    set xmlbrokermonitor "POST /scripts/WPnBr.dll HTTP/1.1\\r\\nContent-Length: $contentlength\\r\\nContent-Type: text/xml\\r\\nConnection: close\\r\\nHost: citrix\\r\\n\\r\\n$postcontent" 

   set monitor_type "http"
   set monitor_name "$appname-CitrixXMLBroker"
   set monitor_interval "3"
   set monitor_timeout "19"
   set send '$xmlbrokermonitor'
   set receive '$appname' 

    tmsh::create / ltm monitor $monitor_type $monitor_name interval $monitor_interval timeout $monitor_timeout send $send recv $receive
   puts "Created monitor $monitor_name, plese attach to the XML Broker pool." 

proc getFeedback { question default } {
   puts -nonewline $question
  puts -nonewline " (Default: $default) "
  flush stdout
  set input [gets stdin]
  if { $input equals "" } {
     return $default
  } else {
     return $input
Published Mar 10, 2015
Version 1.0

Was this article helpful?


  • Hi, I've been trying to monitor our XenApp environment which is running on version 7.5. But it doesn't work. Is there any modification needed to the script to make it work for 7.5? Can I find any logs/debug on for this script specifically? thanks!
  • Does anyone know what determines the order the XML brokers enumerate the application in in response to this health check? We have a problem where the application name we're looking for in the monitor is occurring after the first 5120 bytes and so is not seen by the LTM. Citrix support has stated that the apps should be enumerated numerically and alphabetically but that doesn't seem to be occurring. Beyond that Citrix support has been useless in addressing this issue, stating it is an "F5 problem".