We have a couple of Citrix XML Broker service we want to loadbalance, and we're having problems implementing an advanced http healthcheck monitor.
Basically, its a pool-member specific monitor with a POST statement we tried with curl, like this:
curl -X POST -H 'Content-type: text/xml' -d @broker_monitor.xml http://10.10.10.10:8080/scripts/wpnbr.dll
The content of the broker_monitor.xml file (contains the POST body):
And here's the response from the server
separate-credentials-validation launch-reference integrated-authentication rade-session-proxy multi-image-icons user-identity full-icon-data full-icon-hash session-sharing
So, I've written the send string in the monitor like this (minding the quotes and carriage returns)
POST /scripts/wpnbr.dll HTTP/1.1\r\nHost: 10.10.10.10:8080\r\nContent-Type: text/xml\r\n\r\n
However, the pool member is marked as down. I don't know what's going on with this ... Can you see anything wrong?
The version is BIG-IP 11.3.0 Build 3164.0 Hotfix HF10
You can do a tcpdump while the monitor is running and inspect the traffic to verify what you think is being sent is being sent, and what you expect to be returned is being returned.
Alternatively, if you have a curl command that works, you could just use an external monitor and monitor via curl:
We installed wireshark on the node, and captured the requests sent from the F5 monitor and from the server from which we run curl. Here both requests and responses:
Curl Request (as seen from the wireshark capture in the node):
POST /scripts/wpnbr.dll HTTP/1.1 User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.18 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Host: 10.10.10.10:8080 Accept: / Content-type: text/xml Content-Length: 169
HTTP/1.1 100 Continue Server: Citrix Web PN Server Date: Tue, 05 Apr 2016 16:45:20 GMT
Curl Response: HTTP/1.1 200 OK Server: Citrix Web PN Server Date: Tue, 05 Apr 2016 16:45:20 GMT Content-type: text/xml Content-length: 673
F5 request (as seen from wireshark capture in the node)
POST /scripts/wpnbr.dll HTTP/1.1 Host: 10.14.44.118:8080 Content-Type: text/xml
Response to F5 (as seen from wireshark capture in the node) HTTP/1.1 400 Bad request Server: Citrix Web PN Server Date: Tue, 05 Apr 2016 16:40:16 GMT Connection: Close
As you can see, CURL added some headers that I didn't include (user-agent, content-length, accept). I tried adding content-lenght, and it didn't work. With or without backslahes count.
You know what it was ? The backslash-Double-quotes don't count as 2 characters, they count as 1. So I added the Content-length header with the appropriate number and it worked.
Pretty stupid ...