Using the XmlServiceReader with Health Monitoring and Recovery (HMR)
|
by Nicholas Dille on 06/16/2009 | 0 Comments | 1,860 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
Monitoring & Recovery Tests in any Language
Trackback URL for this post:
- ‹‹‹ previous Article
- 46 of 80
- next Article ›››
[Your opportunity] IT-Competence and work-live-balance is our USP. Continue your career with sepago! Immediate job offers
Tags
0 responses for "Using the XmlServiceReader with Health Monitoring and Recovery (HMR)" |
Add Comment
![]() |
Nicholas Dille Head of Technology and Innovation Blogs about Centralized computing, virtualization and performance monitoring Personal Profile Personal Blog RSS-Feed ![]() Twitter: NicholasDille ![]() |
|
Related Jobs
Latest posts
Most viewed
| Title | |
|---|---|
| 11,524 Views |
Who Needs Aero Glass Remoting? Although It's Cool! |
| 10,117 Views |
Jailed 32-Bit Processes on Windows x64 (Update) |
| 6,217 Views |
Emulating a Redirecting Load Balancer for WI and PNA |





