Forum Discussion

Greg_Donohoe_25's avatar
Greg_Donohoe_25
Icon for Nimbostratus rankNimbostratus
Sep 22, 2015

irule response with static HTML message when pool members are down

Hi, I am trying to create an irule to respond with static HTML message when the pool members are down but I am having problems with the syntax. So when all pool members are down I want to display a message like: "Page not available. Please use following to connect to URL for respective environmet: Server1= Server2=

 

Would anyone have any working examples of this scenario or any input?

 

3 Replies

  • Hello, Greg

    Give it a shot

    when HTTP_REQUEST {
    
       Respond from F5 with HTTP 503 error, if no pool members are available for the selected pool. If other iRules or LTM policies don't specify otherwise, then the selected pool is the same as the Default Pool as configured in Virtual Server settings.
      if { [active_members [LB::server pool]] < 1 } {
        HTTP::respond 503 content "Page Not AvailablePage is currently unavailable. Please click on the following links to connect to respective environment directly:
     \
          
     \
           \
          "
        event disable
        TCP::close
      }
    }
    
  • Thanks Hannes. The syntax you gave is correct and the irule is now in place. I will test and let you know the outcome.