Forum Discussion

2 Replies

  • Create a virtual called vs_healthcheck with IP address 2.2.2.2:80, a http profile and the following iRule. Make sure you are not using this address for any traffic passing through your BIGIP. If you are, choose another address.

    when HTTP_REQUEST {
      set type [getfield [HTTP::uri] "/" 2]
      set mypool [getfield [HTTP::uri] "/" 3]
      set mymin [getfield [HTTP::uri] "/" 4]
    
      if {$type eq "pool"} {
        if {[active_members $mypool] >= $mymin} {
          HTTP::respond 200 content "UP"
        } else {
          HTTP::respond 200 content "DOWN"
        }
      }
    }
    

    Deployment Say we have virtual vs_application which relies on the following pools

    • pool1
    • pool2
    • pool3
    • pool4

    Before you start, every pool needs normal healthcheck so its green. This is important or active_members check will not work.

    Now assign the first pool "pool1" to the virtual so the virtual status goes green. Now create additional monitors for all the pools. Each monitor will have a send and receive string as follows

    Monitor Name    Send String        Receive string    Alias Address  Alias port
    monitor_pool1   GET /pool/pool1/1  UP                2.2.2.2        80
    monitor_pool2   GET /pool/pool2/1  UP                2.2.2.2        80
    monitor_pool3   GET /pool/pool3/1  UP                2.2.2.2        80
    monitor_pool4   GET /pool/pool4/1  UP                2.2.2.2        80
    

    Add all these new monitors to pool1. Make sure the availability requirement for pool1 is set to all. If any pool goes down, the virtual will go down. Note the "1" at the end of the Send String refers to the minimum number of pool members for the monitor to consider the pool is up.

    • Kevin_Davies_40's avatar
      Kevin_Davies_40
      Icon for Nacreous rankNacreous
      Note: You need a default route on the BIGIP in order to reach the 2.2.2.2 virtual. Otherwise use an address in an attached network. Note2: The Send String should always have \r\n on the end of it.