Forum Discussion

swjo_264656's avatar
swjo_264656
Icon for Cirrostratus rankCirrostratus
Jan 10, 2018

About i-Rule active_members...

Hi guys.

I`m using i-Rule about using 'active_members'

when CLIENT_ACCEPTED { if {[active_members P-10.10.10.10-80-L3DSR] < 1}{ reject } }

I

ll apply this rule to many virtual server but I don
t want to make rule per vs.

ex) VS-1 / P-1 when CLIENT_ACCEPTED { if {[active_members P-1] < 1}{ reject } }

ex) VS-2 / P-2 when CLIENT_ACCEPTED { if {[active_members P-2] < 1}{ reject } }

not this situation, I want to apply common rule. use one rule to many VS.

is there any method using active_members [default pool] << like this.

thank you.

1 Reply

  • You do not need an iRule for this. You can select 'Action On Service Down' to 'Reject' under the pool configuration.

    That way when the pool is down (active members < 1 ) it will reject subsequent requests

    Alternatively, if you really want to use an iRule, you can retrieve the default pool assigned to the VIP with

    [LB::server pool]
    - iRule below is untested

    when CLIENT_ACCEPTED { 
        set default_pool [LB::server pool]
        if {[active_members $default_pool] < 1}{ 
            reject 
        }
    }