External class and class command
The problem is that, my output will only show the last member of each pool. For example, if there are three entries in the class like shown below, the iRule will only output the last. So if there are 10 pools, all with 3 members, I will only get 10 entries in the output rather than 30. Additionally, when I check the size of the class using class size class_name, I would get 10 as the return value.
"test_http-pool" := "1.1.1.1:http",
"test_http-pool" := "2.2.2.2:http",
"test_http-pool" := "3.3.3.3:http",
Here is the cron change I made to query for all pools all members and write out the class file:
b pool all member all | grep POOL | awk '{print "\""$3"\","}' | sed -e 's/\//\" \:\= \"/g' | sort >/var/class/pool_member_status_list.class
Is the problem in using duplicates of a single name even when each of their value pairings are unique?
Here are the main changes to the iRule:
when HTTP_REQUEST {
...
...
for {set i 0} {$i < [class size pool_member_status_list]} {incr i} {
if { [catch {
set poolname [class element -name $i pool_member_status_list]
set addrport [class element -value $i pool_member_status_list]
scan [split $addrport ":"] %s%s addr port
switch -glob [LB::status node $addr] {
...
...
}
} errmsg] } {
...
...
}
}
}
Thanks in advance for any assistance, and for providing a great resource!
Anthony