Forum Discussion

Sridhar_111831's avatar
Sridhar_111831
Icon for Nimbostratus rankNimbostratus
Jul 21, 2011

URI Function and LB_Failed

Hi All,

 

 

Need help on setting up a irule. Here is the requirement.

 

 

The web servers host mulitple application instance. We already have a test page being monitored. They added a new app instance and they want to monitor specific page and if all pool members fails, it should redirect to fall back pool only for the newly added instance.

 

 

Now, I created separate pool and assign monitor to check the new app page. However, I need help on setting up irule to check uri for /app and then point to a pool and if that pool fails it should direct to fall back pool.

 

 

 

Help Please.

 

 

Regards,

 

Sri

 

 

  • I currently have this...

     

     

    when HTTP_REQUEST {

     

    if { [HTTP::uri] starts_with "/app1" } {

     

    if { [active_members [LB::server pool]] == 0 } {

     

    pool fall_back_pool

     

    elseif { pool orginal_pool }

     

    }

     

     

    }

     

     

    This doesnt help because the pool assigned with VIP has generic monitor mapped with it. However, I need different monitor for orginal_pool (used by app1)

     

     

    please suggest.
  • Hello there,

     

     

    Can you give this rule a try?

     

     

    when HTTP_REQUEST {

     

    if { [HTTP::uri] starts_with "/app1" } {

     

    pool original_pool

     

    }

     

    }

     

    when LB_FAILED {

     

    if { [active_members http_pool] == 0 } {

     

    log local0. "Pool [LB::server pool] has an active mbrs = [active_members [LB::server pool]]"

     

    pool fall_back_pool

     

    log local0. "Page went to Fallback pool"

     

    persist none

     

    LB::reselect

     

    }

     

    }

     

     

     

    hope that helps..