This HOWTO describes the process of configuring a Citrix Netscaler to monitor for a keyword on a load balanced website and if that key word is not found (ie the node has failed), remove it. Once removed, continue scanning and once the node is back up, read it.
- The foundational technology we use here is called a “Monitor” which in Citrix parlance is a entity that can be used to repeatedly check some condition against some service
- While you can configure monitors from the GUI, it turns out the GUI adds some random carriage returns that breaks the entire process so you have to do it from the CLI
- So first you want to putty into the Netscaler. Once logged in, you can type “shell” to access the full linux command line. In our case, we don’t want to do that as we are running Netscaler specific commands
- Create a new monitor using the command:
add lb monitor [monitorname] TCP-ECV -send “GET / HTTP/1.1\r\nHost:[hostheadername]\r\nConnection:Close\r\n\r\n” -recv [Keywordtosearchfor] -LRTM ENABLED
-
What this command does is:
- creates a monitor called monitorname and makes it based on the built in template “TCP-ECV”. The arguments provided to the –send parameter tell it what to send to the IP address you’ll configure later. (You can probably configure it on the same line but I don’t know how to do that yet).
- The GET / says get the root page. So in this case, hostheadername doesn’t have an index.html or anything on the end so we can simply request the root page.
- Because we are using host headers, we have to provide the host we are looking to connect to. (This was the hardest part to figure out). You’ll note the line remarks for \r and \n. Those are critical as they must follow the HTTP standard.
- The “connection close” close the connection after you obtained the information you needed so you don’t leave it hanging open.
- Keywordtosearchfor is the string we’re looking for in the results to determine if the page is serving the content you expect or not.
- The LRTM stands for “Least Response Time using Monitoring”. I don’t know what it does but it seems like I need it.


