Forum Discussion

Chris1269_13050's avatar
Chris1269_13050
Icon for Nimbostratus rankNimbostratus
Nov 18, 2013

HTTP Health Monitor Receive String issue

I am currently having an issue with the Receive string part or a HTTP health monitor. I am using a GET request like: GET /default.aspx HTTP/1.1\r\nHost: myurl.com\r\n

 

I am also using authentication which seems to work fine. What i want is to check the HTML for something like 'hello' within the title/body or whatever. The monitor works as when i input 200 ok - the pool appears as up. Also, the Receieve String does not.

 

Does anyone have a working example of a receive string that looks for a match within the body rather than just the Header or simple HTML tags?

 

Thanks

 

11 Replies

  • The receive string formatting is very flexible, just enter the string you're looking for as it appears in the response. For instance: Look For This String. It is case sensitive.

     

  • I have tried that - could it be something to do with encoding? F5 redirects to HTTPS. Will this require a HTTPS health monitor instead? The only thing i can really get working is 200 OK.

     

    Please note that when the website is first launched a login box appears right away in which i assume credentials i specified when creating a HTTP Health monitor are passed through ok. (Within the username and password section)

     

    Anyhelp or a working example of a receieve string would be greatly appreciated.

     

  • OK, is the traffic between the F5 and server(s) SSL or plain HTTP?

     

    Any string should work, there's nothing special about it at all. I'd suggest you do a packet capture server-side to actual confirm what comes back from the server in response to the monitor and also confirm the authentication works. Can you do that?

     

  • Thanks, this issue has now been resolved. I needed to add User-Agent to the request.

     

    • Gerlan_32355's avatar
      Gerlan_32355
      Icon for Altostratus rankAltostratus
      I inserted the User-Agent on request and worked well, too! Thanks for help! Follow the example of request: GET /system1/ HTTP/1.1\r\nHost: host1.mydomain.com\r\nUser-Agent: Mozilla/4.0 (Compatible; MSIE 6.0; Windows NT 5.0; T312461)\r\nConnection: Close\r\n\r\n Receive string: SystemOK
      • Aaron_F's avatar
        Aaron_F
        Icon for Nimbostratus rankNimbostratus

        Ran into new use for this information. New Tomcat server deployments are returning HTTP 200 responses when sending CURL requests from the F5, but when using a basic HTTP health monitor, it was getting HTTP 500 response, resulting in failed health check. Turns out that new Tomcat web server versions are requiring User-Agent: be defined in the health monitor call from the F5 to the tomcat web servers running new software.

  • Can you share your actual SEND and RECEIVE strings (sanitized as needed). I'm trying to accomplish the same thing in that I'm looking for "ok" in the RECEIVE string text. I'm not interested in what's in the header. My application owner intends to run his own downstream tests and provide me with either ok or notok. I only care to match on the text ok. I can't get anything to work. I've tried every combination of regular expression matching for ASCII and HEX, quotes, no quotes, \r\n, no \r\n....can't get anything to work. If I use Fiddler I see the raw response is ok.

     

    • Peter_Z's avatar
      Peter_Z
      Icon for Cirrus rankCirrus
      You should look for the string that is unique and different when the 'good' and 'bad' response is received. Note if your server returns ok or notok and you will set receive string to ok, you will have a match in both cases as the 'ok' string is present in both responses - so the member will stay UP even when it returns notok.
  • I have managed to fix the issue by simply adding the required user agent to the string! Hope this helps