Forum Discussion
George_33482
Nimbostratus
Mar 10, 2012iRule pool selection after checking
Hello,
Kindly i need some assistance to complete part of the iRule. i have a LC and i want to select a pool member based on source address. But first i want to check if the pool member is up before, otherwise i will select the whole default pool.
part of the iRule is:
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 10.10.10.10] } {
if {[check if the pool member 1.1.1.1 is up }{ ----------<<<<<< how to write it?
pool default_pool member 1.1.1.1
} else {
pool default_pool }
}
Do i need another function LB::SELECTED to make it work.
Regards,
George
6 Replies
- nitass
Employee
can you try LB::status?
LB::status wiki
https://devcentral.f5.com/wiki/iRules.lb__status.ashx - Ian_SmithRet. EmployeeTry something like:
set p my_pool_name set m my_pool_member_ip:port if { [active_members $p] > "0" } { if { [lsearch -exact [active_members -list $p] $m] } { pool $p member $m } else { pool $p } } - George_33482
Nimbostratus
Thank you. I will try the code.
But while searching for every part of the line " if { [lsearch -exact [active_members -list $p] $m]" to understand it, I read that the option "list" in the active_member is not supportive in the GTM.
Do you think LC also do not support this option?
Regards,
George - Chris_Miller
Altostratus
If you can't do active_members, can you do priority group activation? - George_33482
Nimbostratus
Hi Chris,
Since i have a Link Controller, in which i faced a problem (a bug) when using the same node in multiple pool, so i cannot use the same node in multiple pool. I am trying to use the default_gateway pool and play on it.
Otherwise, I could have created a pool including one node and check if this pool is up, without getting into this delimma
All what i want is to check if a pool member is up in a Link controller license box....
Regards,
George - George_33482
Nimbostratus
Hello,
Thank you Ian, the code worked but i had a problem with the variable p and m and i had to reply them with there real names in the code.
Anyway i appreciate everybody support.
Regards,
George
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
