Forum Discussion

shadow82's avatar
shadow82
Icon for Cirrus rankCirrus
May 16, 2023

How to create custom monitor

Hi! Recently I got a request to change my pool monitoring. I have a pool of 2 nodes listening for http connections on port 8080 So my pool monitor was http on port 8080 Recently admins have chang...
  • Paulius's avatar
    May 16, 2023

    shadow82 If your pool member is listening on port 8080 you do not have to define the Alias Service Port in the health monitor because it will inherit the port from the pool member when the health monitor is performed. Now as far as the send string is concerned, I would use HTTP 1.0 instead of 1.1 since you aren't really defining an appropriate Host value. The reason for the "HEAD" rather than a "GET" is because it doesn't seem as though you are interested in anything from the body of the page so no need to query anything but the HTTP header. In addition to that, your receive string is incorrect and should use an escape \ after the HTTP in the response.

    Send String: HEAD /stats HTTP/1.0\r\nConnection: Close\r\n
    Receive String: HTTP\/1\.(0|1) 200 OK

    Realistically if they would like for this to be an HTTP 1.1 connection they shoud provide you with an appropriate host header value rather than the IP of the pool member you are balancing traffic to. If they decide to use HTTP 1.1 and they provide you the appropriate Host value your health monitor should look similar to the following.

    Send String: HEAD /stats HTTP/1.1\r\nHost: www.example.com\r\nConnection: Close\r\n\r\n
    Receive String: HTTP\/1\.(0|1) 200 OK

    Now if you wanted to know why the health monitor is failing you should be able to perform the following tcpdump and replacing the information where the <> are less the <> to filter the tcpdump a bit further.

    tcpdump -nnvvvi 0.0 host <f5_selfIP_closest_to_destination> and host 10.0.10.11 and port 8080

    This should show you the response from the pool members in relatively plain text so you can see what the server is responding back with. The following is a curl command you can enter on the F5 CLI in bash to see what the pool member is responding with.

    *** No Host header value ***
    curl -Ivk "http://10.0.10.11:8080/stats"

    *** Host header value ***
    curl -IvkH 'Host: <your_fqdn>' "http://10.0.10.11:8080/stats"