Robberhines_120
Jul 14, 2016Nimbostratus
Have Passive monitor iRule skipped if url contains
We are trying to setup a passive iRule that will mark a load balanced member down if it gets a number of errors from the server. I found an example of one and it seems to work OK however our developers stated that some of the API calls the develop can return a 500 error and that is to be expected. Luckily all the API stuff is under a /services/ url. Is there an easy way to take the code below and have it just exit the rule if the url contains /services/ in the url?
when HTTP_REQUEST {
if { not [info exists orig_request]} {
set orig_request [HTTP::request]
}
}
when HTTP_RESPONSE {
if { [HTTP::status] >= 500 } {
set failures [session lookup dest_addr [LB::server addr]]
if { $failures >= 3 } {
LB::down
log local0.warning "Pool member down for '[LB::server addr]' - May want to investigate"
} else {
session add dest_addr [LB::server addr] [incr failures]
LB::detach
HTTP::retry $orig_request
}
}
}
Reference URL:
F5 Friday - Eavesdropping on avialability