Forum Discussion

vvskaladhar_488's avatar
vvskaladhar_488
Icon for Nimbostratus rankNimbostratus
Aug 27, 2013

Question : Page redirection to Maintenance page when pool members are down

Can some one pelase help me with model Irule for page redirection to Maintenance page ( HTML ) when all the pool members are down during the Maintenance window ? What all the requirements from server end and f5 end ?

 

6 Replies

  • You can use i rule to redirect to url which contain sorry/ maintenance page You can setup sorry page locally or on server other then pool member Server end:-  one server containing sorry page should be up f5 end :- when all pool member are down, it should redirect to sorry page.( with help of irule ) Eg:- when HTTP_REQUEST {                if { [active_members [LB::server pool]] == 0 } {                                HTTP::redirect "http://sorry page or maintenance page"                } } } for more ref :- https://devcentral.f5.com/s/articles/hosting-sorry-error-or-maintenance-pages-on-big-ip-ltm-with-irules https://devcentral.f5.com/s/feed/0D51T00006i7PeFSAU http://www.resdevops.com/category/networking/f5/
  • You can try:

    when LB_FAILED {

    if { [active_members [LB::server pool]] < 1 } {
    
    HTTP::fallback "http://host.domain.com/redirect.html"
    
    }
    
    }
    
  • there are a couple of options such as what bigip version are you running (9.x/10.x or 11.x)?, where is maintenance page (server or bigip)?, would you like to change url shown on a browser?

    if maintenance page is on server and you just want http redirection, Vitaliy's irule or something like below may be usable.

    e.g.

    root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm rule myrule
    ltm rule myrule {
        when HTTP_REQUEST {
      if { [active_members [LB::server pool]] < 1 } {
        HTTP::redirect "http://www.google.com"
      }
    }
    }
    

    hope this helps.

  • I use the redirect method all the time. However my code looks more like this ( == 0 , as in no active members)

     

    Or even:

     

    ltm rule myrule {
        when HTTP_REQUEST {
      if { [active_members [LB::server pool]] == 0 } {
        HTTP::redirect "http://www.google.com"
      }
    }
    }
  • another good idea is to keep Maintenance page ( HTML ) as iFile on F5 device and use an iRule:

     when HTTP_REQUEST {
        if {[active_members [LB::server pool]] < 1} {   
        HTTP::respond 200 content [ifile get iFile_name]
        }
        }