Forum Discussion

Chris_Bone's avatar
Chris_Bone
Icon for Nimbostratus rankNimbostratus
Dec 22, 2020

Service Unavailable Web Page for multiple irules within a single VS

Hi,

I’m looking to create a service unavailable web page irule for a single VS which has multiple service irules, each with a different associated pool. No default pool associated with VS. The unavailable irule must monitor each service irule within the VS but only deliver the unavailable web page for the service which is down, not effecting the other services associated with the VS.

I have managed to create a service unavailable irule for a single service within the VS but when I add another service irule then whichever irule pool is down then all services are delivered with web page.

 

Service Unavail for single (Service-1) irule

when HTTP_REQUEST {

   if { [active_members [LB::server pool]] == 0 } {

     HTTP::respond 200 content [b64decode [class element –value 0 “required web page image”]] "Content-Type" "mainpage"

   }

}

-----------

Service-1 irule

when HTTP_REQUEST {

 if     {

                        ([HTTP::uri] contains "/blah/") ||

                        ([HTTP::uri] contains "/blah-blah/") }

                {

                 pool POOL-5-6

                  }

                 }

 

Service-2 irule

when HTTP_REQUEST {

 if     {

                        ([HTTP::uri] contains "/service/") ||

                        ([HTTP::uri] contains "/service2/") }

                {

                 pool POOL-7-8

                  }

                 }

 

I have tried amending the service unavail irule to use “active_members” pools associated with service irule  and contains uri statement, but the URL results in trying to down load the image, even though the pools members are up.

Is this possible? Can I create a single Service Unavailable irule! Do I need to add the Service Unavailable content to each service irule?

Are there any examples of what I’m trying to achieve.

Thanks Chris

1 Reply

  • Sorry, missed off the additional 'Service Unavailable' irule which, when VS pool members are active this rule keeps uploading the b64decode image. Not sure why!!!

     

    Service Unavail for possible multiple Service irules

    when HTTP_REQUEST {

    if {[active_members POOL-1] == 0 }{[HTTP::uri] contains /online/]}

    HTTP::respond 200 context [b64decode [class element -value 0 “required web page image”]] "Content-Type" "mainpage" 

    }