For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

TSOL_94460's avatar
TSOL_94460
Icon for Nimbostratus rankNimbostratus
Jul 23, 2015

Custom http health check

Hi

 

We are trying to configure a custom health check. This health check should review one web that when services is up it returns "OK", and when service is down it returns "ERR". I attached both answers

 

GET / r\host: http:///healthcheck/exe.php?source=window\r\n\r\n

 

HTTP/1.1 200 OK Date: Wed, 22 July 2015 02:07:45 Europe/Madrid Connection: close Server: CheckIfx/1.00 Accept-Ranges: bytes Content-type: text/plain Content-Length: 2 Last-Modified: Wed, 22 July 2015 02:07:45 Europe/Madrid

 

OK

 

HTTP/1.1 200 OK Date: Wed, 22 July 2015 02:07:53 Europe/Madrid Connection: close Server: CheckIfx/1.00 Accept-Ranges: bytes Content-type: text/plain Content-Length: 3 Last-Modified: Wed, 22 July 2015 02:07:53 Europe/Madrid

 

ERR

 

When We configure "OK" as Receive String it works but I think that it matches with field "HTTP/1.1 200 OK" not with response "OK". Because when We configure "OK.*OK" or "OK$" healthcheck is down

 

9 Replies

  • Hi!

    Not sure if this will work, but you try this one:

    \r\nOK

    That would possibly match

    OK
    

    But not:

    HTTP/1.1 200 OK
    

    /Patrik

  • Thank you very much Patrick, but it doesn´t work.

     

    Also We have tried with many regular expresions with the same result.

     

  • Hi again!

     

    I tested it myself just now and it worked fine. Could you please paste the monitor results in a "Preformatted code window (mark the text and to CRTL + k, or use the button in the tools above)?

     

    /Patrik

     

  • you could just use 200 in the receive string to keep the servers up. If the service is down it should not be returning a 200 response code.

     

    • Telef__243_nica's avatar
      Telef__243_nica
      Icon for Nimbostratus rankNimbostratus
      It does not work, because when a error ocurrs php script that checks the system returns HTTP/1.1 200 OK Date: Wed, 22 July 2015 02:07:53 Europe/Madrid Connection: close Server: CheckIfx/1.00 Accept-Ranges: bytes Content-type: text/plain Content-Length: 3 Last-Modified: Wed, 22 July 2015 02:07:53 Europe/Madrid ERR
    • THi's avatar
      THi
      Icon for Nimbostratus rankNimbostratus
      Is it possible to add something to the php script "OK" response to make it unique? Just to remove the ambiguity.
  • I did a test in my lab to look for a string of text in the receive string "success" for a known page we use to health check servers. If the string is not present the monitor will fail the server. here is the request and response GET /serverhealth/health.asp HTTP/1.1 Host:healthcheck.my.domain.org Connection: close

     

    HTTP/1.1 200 OK Cache-Control: private Content-Length: 129 Content-Type: text/html Expires: Fri, 24 Jul 2015 12:15:02 GMT Server: Microsoft-IIS/7.5 X-Powered-By: ASP.NET Date: Fri, 24 Jul 2015 12:15:02 GMT Connection: close

     

     

    success

     

     

    The monitor request was using GET /serverhealth/health.asp HTTP/1.1\nHost:healthcheck.my.domain.org \nConnection: close\n\n the receive string I used was the word success

     

    If you have a word in your receive string that's not present when the script fails this same monitor could work for you

     

  • I tried it but it didn´t work

     

    Can you be more specific?

     

    What did you try?

     

    Is "OK" at the beginning of the string?