Forum Discussion
Festus_50639
Dec 03, 2008Nimbostratus
Colin, thanks for the sanity check and reply.
That being said,,,
It seems that what the customer wants isn't exactly what was conveyed.
Here is what I'm left with to do:
1. Create a pool for each of the service end points - Done
2. Create a health monitor for each of the service end point pools - In progress
3. Create a string class containing the service end point names (for matching to pools) and service end point pool port numbers - Done (string entries in class are ":" and svc_name equals service pool name as noted in item 1.)
4. Create an iRule that compares the health of the selected node in the default pool (request entry point) and the health of the service end point on the same selected node and process the request if both values are "true" or reselect if either is false.
I have what I think is a completed iRule, but I'm getting an error that the command is out of context in regards to the bit below.
"when LB_SELECTED {
if { ([LB::status pool [LB::server pool] member [LB::server ip] [LB::server port]] eq "up") and ([LB::status pool $svc_pool member [LB::server ip] $svc_name-port] eq "up") }"
===iRule begin===
when HTTP_REQUEST {
pool esb_8981_pool
set sel_node [LB::server name]
set front "esb_"
set back "_pool"
set svc_name [getfield $svc_uri "eProxy/service/" 2]
set svc_pool [concat $front$svc_name$back]
foreach line $::esb_svc_name-port_class {
if {[string match [getfield $line ":" 1] $svc_name] } {
set svc_name-port [getfield $line ":" 2]}
}
when LB_SELECTED {
if { ([LB::status pool [LB::server pool] member [LB::server ip] [LB::server port]] eq "up") and ([LB::status pool $svc_pool member [LB::server ip] $svc_name-port] eq "up") } {
eval $sel_node
} else {
LB::reselct }
}
}
===iRule end=====
If someone could take a look at that iRule and tell me where my syntax is out of whack, I would surely appreciate it.
Thanks,
Kevin