Forum Discussion

Kiran_Kumar's avatar
Kiran_Kumar
Icon for Nimbostratus rankNimbostratus
Feb 03, 2014

monitor to turn off pool member if http response is 501 or 502 0r 503

Hi Friends,

 

Following is the path to be used in GET field "/monitoring/health.svc" The monitor is expected to turn server offline only when http response code is 501/502/503. Please help me configuring the send and receive string for the monitor in standard format. I am running 10.4 version LTM

 

Thanks

 

14 Replies

  • this is for send string.

    sol2167: Constructing HTTP requests for use with the HTTP or HTTPS application health monitor

    http://support.f5.com/kb/en-us/solutions/public/2000/100/sol2167.html

    you may use reverse setting.

    Reverse setting
    
    With the Reverse setting set to Yes, the monitor marks the pool, pool member, or node down when the test is successful. For example, if the content on your web site home page is dynamic and changes frequently, you may want to set up a reverse ECV service check that looks for the string "Error". A match for this string means that the web server was down.  
    

    Configuring Monitors

    http://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm_configuration_guide_10_0_0/ltm_monitors.html1215710

    and this is for receive string.

    sol5917: Using regular expressions in a health monitor Receive String

    http://support.f5.com/kb/en-us/solutions/public/5000/900/sol5917.html
  • Hi nitass,

     

    Could you please confirm if these are correct. I tried them but pool member is marked down, actually the member is up.

     

    send string : GET /monitoring/health.svc HTTP/1.1\r\nHost: \r\nConnection: Close\r\n\r\n

     

    receive string: ^HTTP\/1.[10]\s50[1-3] with reverse setting.

     

    so if response code has 501 and 502 and 503, the pool member shld be offline. Please let me know if I have made any mistake in the syntax as the above is not working.

     

    • JG's avatar
      JG
      Icon for Cumulonimbus rankCumulonimbus
      Shouldn't the the dot be escaped?
    • Kiran_Kumar's avatar
      Kiran_Kumar
      Icon for Nimbostratus rankNimbostratus
      Hi Jie and Nitass, So to give you more details: when I do a curl from F5, I see http 200 code. But my monitor gets a http 500 code. Is there anything that i should add to the send string. Please advise? below are the details [admin@LTM1:Active] ~ curl -v http://10.10.53.41/Health/Monitoring.svc * About to connect() to 10.10.53.41 port 80 * Trying 10.10.53.41... connected * Connected to 10.10.53.41 (10.10.53.41) port 80 > GET /Health/Monitoring.svc HTTP/1.1 > User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 > Host: 10.10.53.41 > Accept: */* > < HTTP/1.1 200 OK < Content-Length: 2836 < Content-Type: text/html; charset=UTF-8 < Server: Microsoft-IIS/7.5 < X-Powered-By: ASP.NET < Date: Thu, 06 Feb 2014 17:46:50 GMT Monitor send string which gets response of http 500 send "GET /Health/Monitoring.svc HTTP/1.1\r\nHost: \r\nConnection: close\r\n\r\n" please let me know if i need to make any changes in the above send string to get http 200 coz I get http 200 using curl
    • JG's avatar
      JG
      Icon for Cumulonimbus rankCumulonimbus
      Shouldn't the the dot be escaped?
    • Kiran_Kumar's avatar
      Kiran_Kumar
      Icon for Nimbostratus rankNimbostratus
      Hi Jie and Nitass, So to give you more details: when I do a curl from F5, I see http 200 code. But my monitor gets a http 500 code. Is there anything that i should add to the send string. Please advise? below are the details [admin@LTM1:Active] ~ curl -v http://10.10.53.41/Health/Monitoring.svc * About to connect() to 10.10.53.41 port 80 * Trying 10.10.53.41... connected * Connected to 10.10.53.41 (10.10.53.41) port 80 > GET /Health/Monitoring.svc HTTP/1.1 > User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 > Host: 10.10.53.41 > Accept: */* > < HTTP/1.1 200 OK < Content-Length: 2836 < Content-Type: text/html; charset=UTF-8 < Server: Microsoft-IIS/7.5 < X-Powered-By: ASP.NET < Date: Thu, 06 Feb 2014 17:46:50 GMT Monitor send string which gets response of http 500 send "GET /Health/Monitoring.svc HTTP/1.1\r\nHost: \r\nConnection: close\r\n\r\n" please let me know if i need to make any changes in the above send string to get http 200 coz I get http 200 using curl
  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    Does the app require a User-Agent header? A while ago we had a vendor app that failed if no User-Agent header was sent, or if that string were empty.

     

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    Check the Host-header also. Your cURL example includes a value, but in your monitor it's blank.