Forum Discussion

cmautner_16848's avatar
cmautner_16848
Icon for Nimbostratus rankNimbostratus
Apr 01, 2008

LB_Fail Redirect (easy question)

Sorry, kind of new to IRules

 

 

We have an LTM, and we often disable servers so we can do maintenance. When no servers are enabled in the pool, we want to redirect them to a webpage which explains the work going on. I can not get a simple redirect test to work however. Are there any flaws in this code.

 

 

when LB_FAILED {

 

HTTP::redirect "http://www.google.com"

 

}

 

 

Thanks!

2 Replies

  • Hi,

    try this:

    
    when HTTP_REQUEST {
      if {[active_members pool1] == 0 } {
        HTTP::redirect "http://www.google.com"
    }
    }

    where pool1 is the name of your pool

    if you try this:

    
    when LB_FAILED {
    log local0. "LB failed triggered"
    HTTP::redirect "http://www.google.com"
    }

    you will see in your log file /var/log/ltm that it is never triggered LB failed is not triggered when all pool members are disabled

    Click here