Forum Discussion
Raj_57800
Nimbostratus
Apr 15, 2010Monitor using host header
I am trying to setup a monitor page using host header. It is working when when it is done manually but not when created as a monitor page. Request experts advice. Thanks
Testing through Telnet
[root@devbox:Active] ~ telnet 165.28.92.111 80 Trying 165.28.81.111... Connected to 165.28.92.111. Escape character is '^]'. GET /monitor/f5bigip.html HTTP/1.1 Host: dev-apps.test.com:80 Connection: close HTTP/1.1 200 OK Content-Type: text/html Last-Modified: Wed, 14 Apr 2010 20:24:28 GMT Accept-Ranges: bytes ETag: "c877f7b10dcca1:0" Server: Microsoft-IIS/7.0 X-Powered-By: ASP.NET Date: Wed, 14 Apr 2010 21:30:20 GMT Connection: close Content-Length: 67 Development - East Node Up Connection closed by foreign host.
[root@devbox:Active] ~ telnet 165.28.92.111 80 Trying 165.28.92.111... Connected to 165.28.81.111. Escape character is '^]'. GET /monitor/f5bigip.html HTTP/1.1\r\nHost: dev-apps.test.com:80\r\nConnection: close\r\n HTTP/1.1 400 Bad Request Content-Type: text/html; charset=us-ascii Server: Microsoft-HTTPAPI/2.0 Date: Wed, 14 Apr 2010 21:29:10 GMT Connection: close Content-Length: 311 Bad Request Bad Request HTTP Error 400. The request is badly formed. Connection closed by foreign host.
My monitor page
GET /monitor/f5bigip.html HTTP/1.1\r\nHost: dev-apps.test.com:80\r\nConnection: close\r\n
Return string
Node Up
Raj
6 Replies
- hoolio
Cirrostratus
Hi Raj,
Which LTM version are you running? Can you try removing the \r\n from the end of the send string?
GET /monitor/f5bigip.html HTTP/1.1\r\nHost: dev-apps.test.com:80\r\nConnection: close
If that works, you can try removing the host header value:
GET /monitor/f5bigip.html HTTP/1.1\r\nHost: \r\nConnection: close
Aaron - smp_86112
Cirrostratus
I think you might need an additional \r\n at the end - like this, as there must be a blank line to terminate the request???
GET /monitor/f5bigip.html HTTP/1.1\r\nHost: dev-apps.test.com:80\r\nConnection: close\r\n\r\n - Raj_57800
Nimbostratus
I tried the following formats and ame error.
GET /monitor/f5bigip.html HTTP/1.1\r\nHost: dev-apps.test.com:80\r\nConnection: close\r\n\r\n"
GET /monitor/f5bigip.html HTTP/1.1\r\nHost: dev-apps.test.com\r\nConnection: close\r\n\r\n"
The interesting part is, I created the following monitor page and applied to the pool. The tcpdump clearly shows the monitor is working.
GET /monitor/f5bigip.html HTTP/1.1\r\nHost: dev-apps.test.com:80\r\nConnection: close\r\n\r\n"
But when it is done on CLI is when we saw the error.
Is it that the CLI does not Recognize syntax ?? - smp_86112
Cirrostratus
I suspect that is the case, since (my understanding is that) Linux interprets "\n" as a CRLF. "\r\n" is used in Windows environments I believe. Maybe TMM is smart enough to figure out the difference, but the Linux kernel is not? - L4L7_53191
Nimbostratus
I think problem is that you're using telnet for this. Use something like netcat instead - it'll honor the literal \r\n characters and allow you to really mock up what the mointor string is doing. When you're doing it via telnet, every time you're hitting the return key you're appending another \r\n, so you're breaking the request, hence the 400 status.
For example, I've copied this from your post above Raj:
echo -e 'GET /monitor/f5bigip.html HTTP/1.1\r\nHost: dev-apps.test.com:80\r\nConnose\r\n\r\n' | nc 10.100.100.10 80
...which produces:
HTTP/1.1 200 OK
Date: Fri, 16 Apr 2010 17:44:20 GMT
Connection: close
Content-Type: text/html
Content-Length: 10
Server: TwistedWeb/9.0.0
Success! Please post back if netcat doesn't work for you.
HTH,
-Matt - hoolio
Cirrostratus
Another thing to consider is that the monitoring daemon, bigd, appends one or two \r\n's to the send string. This has changed slightly over different versions. It consistently causes problems when setting up monitors for a server that strictly enforces the HTTP RFCs for delimiters.
SOL2167 provides some good info on this:
SOL2167: Constructing HTTP requests for use with the HTTP or HTTPS application health monitor
https://support.f5.com/kb/en-us/solutions/public/2000/100/sol2167.html
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects