27-Apr-2021 11:01
Hi Folks,
We've following requirement to configure HTTP health monitor and this is what we need to implement.
Type Send Receive
HTTP GET /Sample/healthchecksimple HTTP/1.1 200|OK
HTTP GET /Sample123/servlet/fcs/ping HTTP/1.1 200|System Current Time
HTTP GET /sample456/test-alive HTTP/1.1 200|OK
HTTP GET /Sample789/manager?query=monitoring HTTP/1.1 302
HTTP GET /Sample459/monitoring/healthcheck HTTP/1.1 200|OK
HTTP GET /Sample324/servlet/fcs/ping HTTP/1.1 200|System Current Time
HTTP GET /Sample438/monitoring/healthcheck HTTP/1.1 200|OK
HTTP GET /healthcheck HTTP/1.1 200|OK
Would like to know if this is correct syntax for Send and Receive string or need to modify? we need to associate this to pool.
27-Apr-2021 11:29
this knowledge article explain how to build send strings quite well: https://support.f5.com/csp/article/K2167
so you first send will end up something like this, where the Host part it optional
GET /Sample/healthchecksimple HTTP/1.1\r\nHost: host.domain.com\r\nConnection: Close\r\n\r\n
as for your receive what are trying to get exactly? HTTP/1.1 200 or OK ? specially those seem a bit odd, as they can easily cause a false up if OK is somewhere further.
27-Apr-2021 12:30
Thanks Boneyard,
I am not sure as we are still in build phase but as per the documentation it should be as below.
Receive String - HTTP/1.1 200|OK
Receive String - HTTP/1.1 200|System Current Time
is there any meaning of | between 200 and OK ?
27-Apr-2021 12:35
and for Send String
GET /Sample/healthchecksimple HTTP/1.1\r\nHost: \r\n\r\n
would be the correct syntax?
27-Apr-2021
22:56
- last edited on
22-Nov-2022
07:47
by
JimmyPackets
Receive String - which documentation did you use for that? the | means or, it is either 200 or OK. which you probably don't want. if you are just looking for HTTP return code 200 then HTTP/1.1 200 OK is fine. for the others it is more difficult to judge without actual output.
this comes mainly down to how your application responds, perform a regular request to it and check the response to see what a good match would be.
Send String - if you dont want to add the hostname then drop that whole part, so like this:
GET /Sample/healthchecksimple HTTP/1.1\r\nConnection: Close\r\n\r\n
though formally this isn't allowed for a HTTP/1.1 request. it also depends on the way your application is setup, it might require a hostname or wont respond correctly without one.
best is to test this with curl or such from a system to see what happens with the different variants.
28-Apr-2021 14:23
The documentation is provided by Application Vendor and I've tested as below. The Receive string is "ok".
do I need to mentioned in Receive string as "200 OK" or only "OK" ? is it case sensitive?
config # curl -k http://X.X.X.X:8445/Sample/healthchecksimple
Bad Request
This combination of host and port requires TLS.
config # curl -k https://X.X.X.X:8445/Sample/healthchecksimple
ok
--------------
I'm struggling to configure Send string. do i need to select HTTP or HTTP monitor?
I've tried few syntax but still failing.
GET /Sample/healthchecksimple HTTP/1.1\r\nHost: \r\n\r\n
GET /Sample/healthchecksimple HTTP/1.1\r\nHost: xyz.ab.com\r\n\r\n
GET /Sample/healthchecksimple HTTP/1.1\r\nHost: xyz.ab.com\r\nConnection: Close\r\n\r\n
is it mandatory to use xyz.ab.com after Host: for HTTP 1.1 ? any suggestions?
28-Apr-2021 14:25
The documentation is provided by Application Vendor and I've tested as below. The Receive string is "ok".
do I need to mentioned in Receive string as "200 OK" or only "OK" ? is it case sensitive?
config # curl -k http://X.X.X.X:8445/Sample/healthchecksimple
Bad Request
This combination of host and port requires TLS.
config # curl -k https://X.X.X.X:8445/Sample/healthchecksimple
ok
--------------
I'm struggling to configure Send string. do i need to select HTTP or HTTP monitor?
I've tried few syntax but still failing.
GET /Sample/healthchecksimple HTTP/1.1\r\nHost: \r\n\r\n
GET /Sample/healthchecksimple HTTP/1.1\r\nHost: xyz.ab.com\r\n\r\n
GET /Sample/healthchecksimple HTTP/1.1\r\nHost: xyz.ab.com\r\nConnection: Close\r\n\r\n
is it mandatory to use xyz.ab.com after Host: for HTTP 1.1 ? any suggestions?
29-Apr-2021 10:54
please try with curl -v -k ...
that shows header information
if the content reply is ok, then your receive string is just that: ok
but be careful because is there is ok in the header it will also trigger
29-Apr-2021 11:07
I removed the TLS and SSL outputs. Does it mean I should also add "HTTP/1.1 200 ok" in receive string or only "ok" just to make sure it detects the correct string to keep the pool member up.
> GET /Sample/healthchecksimple HTTP/1.1
> Host: X.X.X.X:8445
> User-Agent: curl/7.47.1
> Accept: */*
>
< HTTP/1.1 200
< Content-Length: 2
< Date: Thu, 29 Apr 2021 17:59:20 GMT
<
* Connection #0 to host x.x.x.x left intact
ok[F5]config #
29-Apr-2021 12:25
in this case just "ok" is fine.
just be careful that you don't take something which also occurs in the header like "on", which is a part of Content-Length.
29-Apr-2021 12:29
Thank you so much boneyard, this really helps.
just last thing , in what cases we need to put "200 OK" as i have seen in some monitors so just wondering. does it mean receive string contains 200 as well ?
29-Apr-2021 12:34
and for one the monitor the receive string mentioned as "HTTP/1.1 302" which is redirection but when i do curl then i see that it redirects but does not see any string similar to "ok" or something else.
how do i configure receive string to set as "302" so it marks up?
< HTTP/1.1 302
< Location: https://XXX.XXX.XXX/abc/xyz
< Content-Length: 0
29-Apr-2021 12:37
well that usually is more focused on the first reponse line you see in the header
HTTP/1.1 200
this often is
HTTP/1.1 200 OK
and then the 200 OK makes sense, in your case there are several lines between the 200 and the ok (also lower case).