Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Custom HTTP monitor syntax

We have created a custom monitor that goes to a specific page HTTPS://domain.com.

Currently we are having issue with the String as the server is seeing that F5 is still checking the hearbeat on https://domain.com/iisstart.htm instead of https://domain.com/alive.png.

Below is the current configuration of the custom monitor that we have created

Send String: GET /alive.png HTTP/1.1\r\nHost:domain.com\r\n\r\n

Receive String: HTTP/1.1 200 OK

Did a Curl check and below are some of the details: curl -vk https://nodeIPaddress/alive.png

GET /alive.png HTTP/1.1 Host: nodeIPaddress Accept: / HTTP/1.1 200 OK Content-Type: image/png

Some output from Server side:

s-computername = "servername"

s-port = 443

c-ip = "F5 floating/self IP"

cs-method = GET

cs-uri-stem = /iisstart.htm

sc-status = 200

Bytes-Sent = 180

Bytes-Received = 7

Appreciate your advise if there is any issue with the string that we have created. Or whether the issue is on F5 string or is it on the server side.

Additional note: The VS is load balancing to 7 nodes (server). And we have configured an iRule x-forwarder as well

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

c-ip = "F5 floating/self IP"

I understand health monitor should be sourced from non-floating selfip.

0
Comments on this Answer
Comment made 4 months ago by LA Medina 14

Hi Nitass,

Thanks for the response.

I'm not exactly sure about that one. But if what you are saying is correct then that should explain it as from what i can see from the output that was provided from server side, most of the IP's are floating IPs. Unfortunately, i dont have access on the server side to confirm the actual setup on their end.

But i just want to confirm that my syntax on F5 is actually correct. :)

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Syntax looks fine to me..
run this command from CLI to check your send string ,
echo -ne "GET / HTTP/1.1\r\nHost: domain.com\r\nConnection: Close\r\n\r\n"; cat) | nc <Pool member IP> <Pool member port>

0
Comments on this Answer
Comment made 4 months ago by LA Medina 14

Hi PK,

Thanks for the response. I run the command and i get the below output:

GET / HTTP/1.1 Host:domain.com Connection: Close

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

LA Medina, you seem to be using the IP address as the Host Header. Do you have other web apps on this IIS instance? It may be using the Default Web Application, and not your specific one. What happens if you add the real host header instead?

0
Comments on this Answer
Comment made 4 months ago by LA Medina 14

Hi Nathan,

Unfortunately, I don't have access to the server directly. The data was only provided by them. But I did notice that when they 'source' it from the non-floating IP of F5 they were able to see the correct heartbeat check. It is returning /alive.png, which is the correct one.

The problem is that it seems they are also seeing the "traffic" from the floating IPs and it is showing the heartbeat check is not the correct one. and from what i understand, the monitor traffic should be 'source' from the non floating IPs?

0
Comment made 4 months ago by nathan 6565

Monitor traffic is from the non-floating IP address. Perhaps they are confusing this with application traffic, which will come from the floating IP address.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

The equivalent curl command to the monitor you have created is:

curl -H "Host: nodeIPaddress" -vk https://nodeIPaddress/alive.png

The equivalent monitor to the curl command you indicated would be:

Send String: GET /alive.png HTTP/1.1\r\nHost:nodeIPaddress\r\nContent-Type: image/png\r\nConnection: close\r\n\r\n

0
Comments on this Answer
Comment made 4 months ago by LA Medina 14

Janholtz, Thanks for the correction. I'll give it a try. :)

anyways, i tried the the curl command you mentioned: curl -H "Host: nodeIPaddress" -vk https://nodeIPaddress/alive.png, it seems to return the same output as the one that I initially used.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

BTW, is it possible to have multiple Send String on the same Health monitor for different hosts?

Say, the current send string is GET /alive.png HTTP/1.1\r\nHost:domain.com\r\n\r\n

but we need to add 2 more as the server IP are hosting multiple url/domain.

so we need something like:

GET /alive.png HTTP/1.1\r\nHost:domain.com\r\n\r\n GET /alive.png HTTP/1.1\r\nHost:domain2.com\r\n\r\n GET /alive.png HTTP/1.1\r\nHost:domain3.com\r\n\r\n

can this be done on the same health monitor or do we need to create an iRule for this?

all 3 host will hit the same VIP and goes to the same nodes/server IP.

0
Comments on this Answer
Comment made 4 months ago by nathan 6565

You would probably need an external monitor to do this or have 3 different health monitors.

0
Comment made 4 months ago by LA Medina 14

Hi Nathan, if we create 3 diff health monitor and apply it on the same pool what will be the behavior especially for the pool member? if one of the domain/url is down, will the pool member be mark as down as well?

0
Comment made 4 months ago by nathan 6565

potentially, so you would most likely need to look at an external monitor. or, you can specify minimum availability in the pool configuration, this sets whether you need all monitors to fail for a pool member to go down, or just one monitor.

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

It would nearly always be better to create multiple pools and associated monitors for this scenario.

Imagine 2 www servers, using host based site directives.

Both are hosting the same content, and when the host header is "foo" will return content "a" and when host header is "bar" will return content "b".

The pools will contain identical members (x.x.x.x:zzz and y.y.y.y:zzz).

Pool "A" has a monitor < GET / HTTP/1.1\r\nHOST: foo\r\nConnection: close\r\n\r\n > Expect response < "a" >

Pool "B" has a monitor < GET / HTTP/1.1\r\nHOST: bar\r\nConnection: close\r\n\r\n > Expect response < "b" >

Now you just have an irule:

when HTTP_REQUEST {
    if { [string tolower [HTTP::host]] equals "foo" }
        pool pool-foo
        } else {
        pool pool-bar
        }
    }
}

This will give you maximum expandibility and flexibility.

//Jan

0
Comments on this Answer
Comment made 4 months ago by LA Medina 14

Thanks Jan.

So if i understand it correctly the setting would be as per below:

VS_main <VIP: 1.1.1.1>

iRule

VS_A <VIP: ?>

Pool_A
<Health Monitor A>
    Member X
    Member Y

VS_B <VIP: ?>

Pool_B
<Health Monitor B>
    Member X
    Member Y

Actually, the setup is that host "foo" is acting as the main host/domain. Then the other host "bar" will be redirected to host "foo". But this is done from the server side not from F5. But they are both pointing to the same VIP and under the same pool and member. So the goal is the health monitor should be set to:

GET /<"a"> and Expect response < "b" >

regardless of which host/domain is being access.

0