Monitor virtual server with a lot of pool configured in une Irule

Hi Guys

I’ve made a virtual server HTTP that have no default pool assigned because I assign the pool with an Irule

This Irule is made to reflect the requirement of real server that respond on different port due to domain name an work fine.

when HTTP_REQUEST {

log local0. “TEST - l’HOST is [HTTP::host], l’URI is [HTTP::uri]”

switch -glob [HTTP::host] {

“*domain1.it” -

“*domain2.it” {

log local0. “TEST - l’HOST e’ [HTTP::host], inside pool-1”

pool pool-1

}

“*domain3.it” -

“*domain4.it” {

log local0. “TEST - l’HOST e’ [HTTP::host], inside pool-2”

pool pool-2

}

etc. etc

}

}

This is the I rule (note the asterisc before the domain is due to satisfy the www or other before).

Now my question is:

The virtual server has no pool specified, what is the best practise to inform the Virtual server that the pool (example pool-2) is out of service?

Note: The pool-1 and pool-2 are the same real server but only on different port.

The real configuration provides about 21 pools always on the same server

Thanks

Are you simply curious about how to represent the Virtual Server as up/down in the GUI, or are you wondering how to support pools within the rule being down? For instance, if pool-2 is down, would you like to send the request to a different pool?

About to rapresent the virtual server as up or down is difficult because with the irule that route the request to 21 pools I think that is not possible or not? But for me is important to notify (with a pool or other method) to the client if the single poll is down.

When you say client, do you mean the person requesting the web site, or the person managing the BIG-IP?

The person that request the web site

Posted By gianluca gozzi on 02/14/2011 07:07 AM

The person that request the web site

In that case, you could simply check whether the number of active members in the pool is less than 1 and if so, respond with some HTML informing them. What would the desired behavior be after that though, send them to a default pool?

As your experience is possible put all in the same Irule or I’ve to do an other?

Posted By gianluca gozzi on 02/14/2011 07:20 AM

As your experience is possible put all in the same Irule or I’ve to do an other?

Same iRule is fine. You’d simply put an additional line above the pool command that checks the number of active members for that pool.

Can you give me a little example inside my irule?

Thanks in advance

Something like this should work. I moved your log statement too…just a personal preference.

when HTTP_REQUEST {
log local0. "TEST - l'HOST is [HTTP::host], l'URI is [HTTP::uri]"
   switch -glob [HTTP::host] {
      "*domain1.it" -
      "*domain2.it" {
            if { [active_members pool-1] > 0 } {
               pool pool-1
               log local0. "TEST - l'HOST e' [HTTP::host], inside pool-1"
             } else { HTTP::respond 200 "Pool-1 is down" }  
           }     
      "*domain3.it"  -
      "*domain4.it"  {
           if { [active_members pool-2] > 0 } {
              pool pool-2
      log local0. "TEST - l'HOST e' [HTTP::host], inside pool-2"
             } else { HTTP::respond 200 "Pool-2 is down" }  
           }
   }
}

Thanks a lot Chris

Posted By gianluca gozzi on 02/14/2011 08:23 AM

Thanks a lot Chris

My pleasure. “active_members” is one of the most useful iRule commands I’ve seen. It’s a great one with which to become acquainted.