Forum Discussion
Marcus_59536
Nimbostratus
Sep 03, 2009iRUle to check current pool member and show if its up.
I currently can see if the current pool is up and name, but I can't see the pool server IP until I actually manually make the F5 make a LB decision.
How can I make that decision within/...
The_Bhattman
Nimbostratus
Sep 04, 2009I believe I see where your problem is. I think the problem stems for the actual load balancing selection that is occurring. taking that into account and doing some tweaking I think this might work nicely for you
when HTTP_REQUEST {
if {[HTTP::uri] eq "/status" } {
scan [LB::select] %s%s%s%s%d command current_pool command2 current_member current_port
eval [LB::select]
set response "$current_pool Pool Status - [clock format [clock seconds]]"
if { [active_members $current_pool] < 1 } {
append response "POOL NAME:$current_pool
CURRENT MEMBER:$current_member:$current_port
STATUS: DOWN
"
} else {
append response "POOL NAME:$current_pool
CURRENT MEMBER:$current_member:$current_port
STATUS: UP
"
}
}
HTTP::respond 200 content $response "Content-Type" "text/html"
}
Keep in mind that the code is forcing the LB evaluation early so this may have impact on load balancing after the code is run.
CB
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
