Acknowledging disabled Pool Member

I am trying to execute a set of commands when all pool members, of a specified Pool, are either down or disabled. It appears as though the following example only matches pool members that are down and not those that are disabled.

1 when CLIENT_ACCEPTED {

2 if { [active_members http_pool] >= 2 } {

3 pool http_pool

4 }

5 }

Has anyone ever setup an iRule that would acknowledge such?

I’m happy to be corrected but I think your best bet here is to use the when LB_FAILED event and select the alternative pool there.

You can use the members command to list all of the members of a pool, regardless of monitor status, and then show their status with the LB::status command. Here’s an example:

when CLIENT_ACCEPTED {
     foreach x [members -list local-pool] {
          log local0. "$x = [LB::status pool local-pool member [lindex $x 0] [lindex $x 1]]"
     }
}

One important thing to note is that a failed monitor and a forced down node will result in the same “down” status, while a disabled and enabled member will show as “session_disabled” and “up” respectively. To get more distinction between down and disabled, you have to query from the shell with TMSH.