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
Jan 11, 2010Here is one example. Keep in mind that this is not dynamic. You have to add to the class object everytime you want something monitored.
class xpools {
"pool_1/192.168.12.1:80"
"pool_1/192.168.12.3:80"
"pool_3/192.168.13.1:80"
}
when HTTP_REQUEST {
if { [HTTP::uri] eq "/status" } {
set response "BIGIP Pool Member Status - \ <br> [clock format [clock seconds]]BIGIP Pool Member Status - [clock format [clock seconds]]\
StatusPool NameMemberPort" foreach { selectedpool } $::xpools { if { [catch { scan [split [getfield $selectedpool " " 1] "/"] %s%s poolname addrport scan [split $addrport ":"] %s%d addr port switch -glob [LB::status pool $poolname member $addr $port] { "up" { append response "UP\ [string tolower $poolname]$addr$port" } "down" { append response "DOWN\ [string tolower $poolname]$addr$port" } "session_enabled" { append response "ENABLED\ [string tolower $poolname]$addr$port" } "session_disabled" { append response "DISABLED\ [string tolower $poolname]$addr$port" } Default { append response "INVALID\ [string tolower $poolname]$addr$port" } } SWITCH END } errmsg] } { append response "INVALID\ [string tolower $poolname]$addr$port" } } append response ""
HTTP::respond 200 content $response "Content-Type" "text/html"
}
I hope this helps
Bhattman
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
