Forum Discussion
Brian_Deitch_11
Sep 22, 2011Historic F5 Account
Dynamic query of all pools
I'm working on a dynamic iRule that will load balance based on the URI. I have that part working fine but the pool selection deviates from our standard. I need to figure out how I can query all the po...
hoolio
Cirrostratus
Sep 26, 2011You could also just assume the pool exists, but use catch (http://www.tcl.tk/man/tcl8.4/TclCmd/catch.htm) to handle a non-existent pool error. This would save the complexity of a separate cron job and datagroup of pool names.
Assign the dynamic pool name, catching any errors for a non-existent pool
if {[catch {pool $my_dynamic_pool} result] == 1}{
log local0. "Error assigning pool $my_dynamic_pool: $result"
pool some_default_pool
} else {
log local0. "Successfully assigned pool $my_dynamic_pool: $result"
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects