Forum Discussion
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\nOKThat would possibly match
OKBut not:
HTTP/1.1 200 OK/Patrik
- Telef__243_nica
Nimbostratus
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
- afedden_1985
Cirrus
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
Nimbostratus
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
Nimbostratus
Is it possible to add something to the php script "OK" response to make it unique? Just to remove the ambiguity.
- Kevin_Stewart
Employee
You could maybe try something like:
^OKwhich checks for "OK" at the beginning of a string.
https://support.f5.com/kb/en-us/solutions/public/5000/900/sol5917.html?sr=46987806
- afedden_1985
Cirrus
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
- Kevin_Stewart
Employee
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?
Recent Discussions
Related Content
* 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