Forum Discussion
Festus_50639
Dec 03, 2008Nimbostratus
Thanks Aaron,
I have swapped the hyphen with and underscore and that seems to have resolved that issue.
I also replaced the "foreach" loop with a cleaner "findclass" command (shown here)
====old way to set variable==
foreach line $::esb_svc_name-port_class {
if {[string match [getfield $line ":" 1] $svc_name] } {
set svc_name_port [getfield $line ":" 2]}
}
====================
====new way to set variable==
set svc_name_port [findclass $svc_pool $::esb_svc_name_port_class ":"]
====================
Here is what the iRule now looks like
===========current iRule iterration=============
when HTTP_REQUEST {
pool esb_8981_pool
set front "esb_"
set back "_pool"
set svc_uri [getfield [HTTP::uri] ? 1]
set svc_name [getfield $svc_uri "eProxy/service/" 2]
set svc_pool [concat $front$svc_name$back]
set svc_name_port [findclass $svc_pool $::esb_svc_name_port_class ":"]
}
when LB_SELECTED {
log local0. "==ESB Tibco: initial lb selection is [LB::select]=="
if { ([LB::status pool [LB::server pool] member [LB::server addr] [LB::server port]] eq "up")\
and ([LB::status pool $svc_pool member [LB::server addr] $svc_name_port] eq "up") } {
eval [LB::select]
} else {
LB::reselect
}
log local0. "==ESB Tibco: final lb selection was [LB::select]=="
}
======================================
It seems to be working as expected, except that when I look at the logs created, it seems to be reselecting the node to which traffic is being sent to even if both of my comparison values are TRUE.
============log samples===============
Dec 3 12:15:25 tmm tmm[1097]: Rule esb_PA-SVC_evaluation : ==ESB Tibco: initial lb selection is pool esb_8981_pool member 10.44.44.147 8981==
Dec 3 12:15:25 tmm tmm[1097]: Rule esb_PA-SVC_evaluation : ==ESB Tibco: final lb selection was pool esb_8981_pool member 10.44.44.162 8981==
==================================
The reselection is interesting and I'd like to figure that out as well.
Thanks again for the assistance.
Kevin