Forum Discussion
Charles_Harris
Nimbostratus
Dec 12, 2008Health Monitor Min Avail Members
Hi,
I've written a monitor for disabling all of a pool's members should a minimum number be unavailable (all disabled + session states) with the idea that it could be targeted to the pool. I can't get it to work targeted to a pool though, it only works when targeted to a member of the pool.
Any ideas / pointers?
Cheers,
ChaZ
- Ian_SmithRet. EmployeeWhen I need to provide this functionality, I use another virtual server (with an iRule that checks the minimum members requirement for the target pool) as the target for a monitor assigned to the pool rather than an external script. This approach has the advantage of using all organic mechanisms, of being supported by F5 support, and of no risk of an external script causing a system failure.
virtual vs_percent_avail { destination 5.5.5.6:http ip protocol tcp vlans stealth enable rules pool_percent_check profiles http tcp }
when HTTP_REQUEST { switch -glob [http_uri] { "/40" { if { [active_members web_pool_secondary] == 0 } { log local0. "40% check - no members in pool" HTTP::respond 200 content "UP" } elseif { [active_members web_pool_secondary] >= 4 } { log local0. "40% check good" HTTP::respond 200 content "UP" } else { HTTP::respond 503 } } "/60" { if { [active_members web_pool_primary] == 0 } { log local0. "60% check - no members in pool" HTTP::respond 200 content "UP" } elseif { [active_members web_pool_primary] >= 6 } { log local0. "60% check good" HTTP::respond 200 content "UP" } else { HTTP::respond 503 log local0. "60% check fail" } } default { HTTP::respond 503 log local0. "monitor check error [http_uri]" } } }
monitor pool_percent_40 { defaults from http dest 5.5.5.6:http recv "UP" send "GET /40" } monitor pool_percent_60 { defaults from http dest 5.5.5.6:http recv "UP" send "GET /60" }
- Charles_Harris
Nimbostratus
Hi ismith, - John_Alam_45640Historic F5 Account
Updated version:
when HTTP_REQUEST { switch [HTTP::uri] { "/40" { if { [active_members web_pool_secondary] == 0 } { log local0. "40% check - no members in pool" HTTP::respond 200 content "UP" } elseif { [active_members web_pool_secondary] >= 4 } { log local0. "40% check good" HTTP::respond 200 content "UP" } else { HTTP::respond 503 } } "/60" { if { [active_members web_pool_primary] == 0 } { log local0. "60% check - no members in pool" HTTP::respond 200 content "UP" } elseif { [active_members web_pool_primary] >= 6 } { log local0. "60% check good" HTTP::respond 200 content "UP" } else { HTTP::respond 503 log local0. "60% check fail" } } default { HTTP::respond 503 log local0. "monitor check error [HTTP::uri]" } } }
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