Forum Discussion

Glenn_32974's avatar
Icon for Nimbostratus rankNimbostratus
Oct 13, 2010

How to check pool availability whit-in an irule

This might be a simple question for you all but I was wondering if there's a way to re-direct traffic to a different pool in case Pool used with-in an irule declaration happens to be down?



Can you check for pool availability within the irule?




let say I have the following irule that directs traffic based on client ip address



What happenss in the event Pool_Global is down?






if {[IP::addr [IP::client_addr] eq "" {


use pool Pool_Global


if pool Pool_Global is down...


use pool Pool_other







makes sense?


3 Replies

  • Hey Glenn,



    This can definitely be done. There are some neat examples in the LB::reselect page ( ) even. Depending on your version you can even do some nifty in-line monitoring with the LB::down and LB::up commands ( - ).



    Hope this helps a bit.



    // Ben


  • You can also check whether a pool has any active members using [active_members $pool_name]:





  • Hey Ben



    Thanks a lot for pointing the right direction. In consequence I was able to achieved pool member availability within the irule






    switch [IP::client_addr] {




    "" {


    if {[LB::status node] eq "up"}{


    rateclass Factura_Digital


    snatpool Factura_Electronica_aivmso_Telmex


    use pool Pool_Telmex


    log local0. "IP address : [IP::client_addr] - aivmso going out via [LB::server addr] Telmex!!! "


    } else {


    rateclass Factura_Digital


    snatpool Factura_Electronica_aivmso_Global


    use pool Pool_Global


    log local0. "IP address: [IP::client_addr] - aivmso going out via [LB::server addr] Global !!!"







    be safe!