Display number of current connections for a pool
Hello, I currently have an iRule to display the status of the members of a pool used by a third-party who I can give access to the box. This works fine but I wrote so long ago I can't remember most of it.
What I need now is to display the number of connections for each pool member either within the same iRule or individual iRules for each member.
To use this iRule I simply create a VIP and attach this without any pools.
browse to http://[ip]/F5-status
when HTTP_REQUEST {
set response "
BIGIP Pool Status for FP Prod/Stby - [clock format [clock seconds]]</div>
<div>
<span class="Apple-tab-span" style="white-space:pre">
</span>
"
if {[HTTP::uri] eq "/F5-status" } {
foreach { selectedpool } [LB::server pool] {
pool [LB::server pool]
if { [active_members [LB::server pool] ] < 1 } {
append response "$response DOWN - $selectedpool
"
} else {
append response "$response UP - $selectedpool
"
}
append response "Number of members=[active_members [LB::server pool] ]
"
}
HTTP::header replace Cache-Control "no-cache, must-revalidate"
HTTP::respond 200 content $response "Content-Type" "text/html"
}
}