Using the XmlServiceReader with Health Monitoring and Recovery (HMR)
|
by Nicholas Dille on 06/16/2009 | 0 Comments | 5,160 Views
|
After publishing the XmlServiceReader and writing about the shortcomings of the health check for the XML service provided by Citrix, I like to expand on the process of creating a custom health check using the XmlServiceReader.
According to an article in the Citrix community, health checks are easily created in any language and even scripts. Such a script needs to return a zero exit code to indicate success and needs to return one if the test failed. The following code demonstrates how a custom request can be supplied and the response can be tested to contain a predefined string. See this article for a detailed description of the XmlServiceReader.
@Echo Off SetLocal Set MyDir=%~dp0 Set MyDir=%MyDir:~0,-1% ( Echo <RequestCapabilities> Echo <Nil /> Echo </RequestCapabilities> )>"%Temp%\XmlServiceReader-request.txt" Type "%Temp%\XmlServiceReader-request.txt" | "%MyDir%\XmlServiceReader.exe" -server %ComputerName% -port 8080 –stream >"%Temp%\XmlServiceReader-response.txt" Type "%Temp%\XmlServiceReader-response.txt" | Find /i "separate-credentials-validation" If ErrorLevel 1 Exit 1 EndLocal Exit 0
Please note that the following script tests the XML service located on port 8080 which may not apply in your environment. The port of the XML service can be read from the TcpPort value located under HKLM\SYSTEM\CurrentControlSet\Services\CtxHttp. Unfortunately, the contents of this value needs to be converted from hexadecimal to decimal.
Before deploying your own script on any of your servers, be sure to use the HMRSDKTester supplied by the HMR SDK. It creates a temporary service running with LocalSystem privileges and displays the output and return code of the script. Citrix also documents the security requirements for HMR tests. I have used this tool to validate the above script.
References
How to Write Your First Health Monitoring & Recovery Test
Health Monitoring & Recovery SDK 4.5
Security Requirements for Health Monitoring & Recovery Tests
- ‹ previous
- 45 of 106
- next ›
+++ Your opportunity +++ Use Profile Migrator 2, the new sepago product that makes migrating user personalities between different platforms a breeze.! Download your free version now!
Tags
Recent Articles
About the author
![]() |
Nicholas Dille Head of Technology and Innovation Blogs about Centralized computing, virtualization and performance monitoring |
Most viewed
| 18,538 Views |
Who Needs Aero Glass Remoting? Although It's Cool! |
| 15,794 Views |
Emulating a Redirecting Load Balancer for WI and PNA |
| 14,348 Views |
Building Custom EdgeSight Reports Part 4 - The Wedding |







Add Comment