Forum Discussion
Bret_McGinnis_1
Nimbostratus
Aug 02, 2005Number of defined nodes in a pool
Is there a way in irules to determine the number of defined nodes in a pool. I'm trying to automate syslog notification when a pool is getting low on nodes. The number of active node is good but I need the context of how many nodes are in the pool. I would take a different action if I have 3 or 20 nodes active then I would if I have 3 out of 4 nodes active.
thanks
13 Replies
- unRuleY_95363Historic F5 AccountGosh, we sure managed to overlook that statistic. I will look into getting it added. Thanks.
- Bret_McGinnis_1
Nimbostratus
Is there any kludge I can use to get this information?
thanks - unRuleY_95363Historic F5 AccountThe only thing I can think of at the moment is to define an array in RULE_INIT that maps how many nodes are in each pool. That might be a bit unmanageable though...
when RULE_INIT { array set ::node_count { pool_A 15 pool_B 20 pool_C 5 } } when LB_SELECTED { set pool [LB::server pool] if { ([active_members $pool] * 100 / $::node_count($pool)) < 10 } { log "Pool $pool is has less than 10% active members!" } } - Bret_McGinnis_1
Nimbostratus
Your suggestion works well.
thanks - Bret_McGinnis_1
Nimbostratus
Hi,
I thought I read somewhere that version 9.2 added the a variable/command to that would return the number of nodes/members defined for pool. Is this true or did I imagine it?
Regards - Roger_Oliver_78
Nimbostratus
Sorry as you can see i'm really new to the 9.x
I have one pool SEARCH_NODES that i want to make sure that out of the 16 I have in that pool that at least 12 are up. I read the above messages and it seems you got it to work. I just don't know where to put it or where to start. I have a sperate "dev" 9x box to test on. not sure what RULE_INIT is. =(
thank you for your help
Feel free to call me newb and point me to a FAQ =) - Deb_Allen_18Historic F5 AccountYou would create a new iRule using the code above provided by unRuleY, modifying the names of the pools & of servers in each to match your situation.
If all you want is a log message when you have less than 12 servers in a specific pool, you can simplify the code to:when LB_SELECTED { if { [active_members SEARCH_NODES] < 12 } { log local0. "Pool SEARCH_NODES has less than 12 active members!" } }
HTH
/deb - Bret_McGinnis_1
Nimbostratus
Hi,
I think that answers roliver question but I don't think it answered my question. Is there a variable/command/function that will return the number of nodes/members defined for a pool?
Regards - Deb_Allen_18Historic F5 AccountSorry, didn't see your follow-up.
But no new commands have been added to return "configured_members" for a pool: You'll have to continue to run with unRuleY's class-based workaround above.
/deb - Bret_McGinnis_1
Nimbostratus
Hi,
Are there any plans to make the configured_members value available to iRules?
Regards
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
