Forum Discussion

jerm1020_254086's avatar
jerm1020_254086
Icon for Nimbostratus rankNimbostratus
Aug 04, 2016

hosting maintenance page via ifile utilizing an irule

I am searching for a solution to an issue a customer has presented. They would like to have a maintenance splash page that will external users will hit when all pool members are down but still allow external users to have access. for a simple "sorry, this page is down for maintenance" page, what files or what kind would need to be referenced within the ifiles. I am very green on iRules and am searching for an irule I can utilize for this. do I need to specify the LB pools within the rule? or can it be a generic irule that when applied to a VS performs this function? F5 has so many capabilities its hard to keep up and learn the ins and outs on the fly. any and all help is always appreciated, thank you!

 

2 Replies

  • Hope Below iRule helps. Change the Pool_Name to your server pool name.

    when CLIENT_ACCEPTED {
      if { [active_members Pool_Name ] >= 1 } {
       pool Pool_Name
      } 
      else {
        HTTP::respond 200 content {   Sorry Page   Sorry, The website is not available. Please try again later  }
        }
    }
    

    -Jinshu

  • Hi jerm1020,

    Can you please try iRule. Please validate & confirm so that i can modify accordingly

          when HTTP_REQUEST {
           if { [active_members [LB::server pool]] == 0 }
              {  set ifileContent [ifile get "/Common/iFile-index.html"]
               HTTP::respond 200 content $ifileContent }
              }