Forum Discussion

JJ_47859's avatar
JJ_47859
Icon for Nimbostratus rankNimbostratus
Oct 03, 2007

setting up a maintenance page using LB_FAILED

Hello DevCentral,

 

 

I've trying to create a maintenance page that will be displayed if our web servers go offline or if we take them down for maintenace. I was testing with LB_FAILED using this code:

 

 

when LB_FAILED {

 

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

 

}

 

 

but can't seem to get LB_FAILED to work. I've setup an HTTP profile that does a basic GET to the web server and then shutdown the world wide web service on the web server which caused the pool to turn red.

 

 

Is the syntax correct? If so, what do I need to do to cause LB_FAILED to work?

 

 

Thanks!

 

 

 

  • Do you have health monitors set up for your nodes/pools? I'm not sure what exact instances LB_FAILED will be triggered, but you might have better luck with it if you have HTTP health monitors set up so that the load balancer knows when the servers go down.
  • Yes, I have HTTP health monitor configured to monitor the pool. I then stopped the WWW service and noted that my pool and virtual server had turned to status of red in the LTM but the iRule would not work. I've been doing a lot of searching today but haven't been able to come up with how LB_FAILED is triggered. Any thoughts are much appreciated. Thanks.
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    The problem is due to the fact that you don't want to use LB_FAILED for this. You want something in the HTTP_REQUEST section that checks the number of active pool members.

    LB_FAILED only fires if load balancing fails (I.E. no members available, no fallback entry, etc. etc.). You can read more about it here: Click here

    Try something like:

    
    when HTTP_REQUEST {
      if {[active_members myHTTPPool] < 1 } {
        HTTP::redirect "http://www.yahoo.com"
      }
    }

    HTH,

    Colin
  • Thank you Colin, that should work out well for us. Thanks for the quick turn around!