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
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?
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:
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