tarsier_90410
Aug 25, 2009Nimbostratus
way to list pools?
I am trying to find a way for an irule (9.x LTM) to query for a list of all pools on the system, but so far have not found a way to do so. Is this possible?
So the class might look like this:
"apache_pool",
"iis_pool",
"coldfusion_pool",
"java_pool",
In v10 the iRule might look like this:
when HTTP_REQUEST {
set response "BIGIP Pool Status - [clock format [clock seconds]]"
if { [HTTP::uri] eq "/status" } {
foreach { selectedpool } [class get pooltest] {
set thispool [getfield $selectedpool " " 1]
if { [catch {
if { [active_members $thispool] < 1 } {
set response "$response DOWN - $thispool
"
} else {
set response "$response UP - $thispool
"
}
} errmsg ] } {
set response "$response INVALID POOL NAME - $thispool
"
}
}
set response "$response "
HTTP::respond 200 content $response "Content-Type" "text/html"
}
}
Kevin