Forum Discussion

adrianglendinning's avatar
adrianglendinning
Icon for Nimbostratus rankNimbostratus
Mar 20, 2024

Health monitor receive string for MM/DD/YYYY HH:MM:SS AM/PM format

Hi,

 

Keen to get a health monitor for a site that should respond with the following where the date/time format is MM/DD/YYYY HH:MM:SS AM/PM

 

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
        Health Check
</title></head>
<body>
    <div>
        3/20/2024 4:25:32 AM
    </div>
</body>

 

Anyone know what this receive string should look like? I found a regex here that looks like the right format but I cant get it to pass. Really appreciate any help.

 

Thanks

Adrian

  • Paulius's avatar
    Paulius
    Mar 23, 2024

    Based on that curl it seems like the path you're attempting to hit doesn't exist. I'm glad it works in the test pool though.

  • adrianglendinning Can you please provide the configuration for your health monitor so that we can see what exactly is being send and what the receive is configured as?

  • Hi Paullius

    Its a HTTPS monitor that trying to access an internal sites health validation .aspx using this as the send string

    GET https://<test.domain.com>/v1/HealthValidation.aspx

    The site replies with a date format of 3/21/2024 5:40:10 AM format giving the current time in US CST

    I'm trying to use a regex as the receive string

    \0[1-9]|1[1,2]\/\0[1-9]|[12][0-9]|3[01]\/\[19|20]\d{2}\s\d{1,2}\:\d{1,2}\:\d{1,2}\s\[AM|PM]

    But this is failing.

    I dont have any username/password configured in the monitor. Reverse and Transparent are both set to No. Im using the VIP IP address that Im testing against as the Alias Address, and te service port is set to 443. Adaptive is not enabled.

    Appreciate any help

    Thanks

    Adrian

     

  • Thanks but it still doesn't like it, getting this in the logs

    [0][6606] 2024-03-21 08:29:53.137524: ID 336   :(_recv_active_service_ping): reading [ tmm?=false td=true tr=false addr=::ffff:<VIP_IP>:443 srcaddr=::ffff:<F5_IP>%0:42482 ]
    [0][6606] 2024-03-21 08:29:53.137553: ID 336   :(do_ssl_read) legacy mode: false [ tmm?=false td=true tr=false addr=::ffff:<VIP_IP>:443 srcaddr=::ffff:<F5_IP>%0:42482 ]
    [0][6606] 2024-03-21 08:29:53.137593: ID 336   :(do_ssl_read): state: 3 [ tmm?=false td=true tr=false addr=::ffff:<VIP_IP>:443 srcaddr=::ffff:<F5_IP>%0:42482 ]
    [0][6606] 2024-03-21 08:29:53.137628: ID 336   :SSL_read() returns -1, error=5 [ tmm?=false td=true tr=false srcaddr=::ffff:<F5_IP>%0:42482 ]

     

    Any other suggestions?

    Cheers

    Adrian

    • Paulius's avatar
      Paulius
      Icon for MVP rankMVP

      Can you provide us with the exact text you receive back in the body of the page and what line number it's on? I know that the F5 will not check after a certain amount of lines in a response and it could be that we haven't accounted for the appropriate amount of white space.

      • adrianglendinning's avatar
        adrianglendinning
        Icon for Nimbostratus rankNimbostratus

        This is the response

        <!DOCTYPE html>

        <html xmlns="http://www.w3.org/1999/xhtml">
        <head><title>
                Health Check
        </title></head>
        <body>
            <div>
                3/20/2024 4:25:32 AM
            </div>
        </body>

         

        The information on line 9 is what is presented when the url is accessed directly (provided the site is healthy). That information is what i need the regex for, as its constantly changing given its a date/time format.

         

        Thanks

        Adrian

  • When I try from the F5 itself

     

    [aglendinning@rl-ltmi02:Active:In Sync] ~ # curl -k -X GET https://<IP_OF_VIP>/v1/HealthValidation.aspx
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
    <HTML><HEAD><TITLE>Not Found</TITLE>
    <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
    <BODY><h2>Not Found</h2>
    <hr><p>HTTP Error 404. The requested resource is not found.</p>
    </BODY></HTML>
    [aglendinning@rl-ltmi02:Active:In Sync] ~ #

     

    However, your regex seems to work if I set the alias to all servers. I currently have it applied to a test pool and its showing green.

    Thanks

    Adrian

     

    • Paulius's avatar
      Paulius
      Icon for MVP rankMVP

      Based on that curl it seems like the path you're attempting to hit doesn't exist. I'm glad it works in the test pool though.