Forum Discussion
tarsier_90410
Nimbostratus
Aug 25, 2009way 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?
Kevin_Stewart
Employee
Aug 25, 2009As with your "set POOLS {}" list example, you can enumerate the pool names from a class. If you use an external class you can use an external monitor script to modify that file at intervals. You'll need to do a "b load" in the script once the file is created, so I'd probably set the monitor on an unused pool and set it to some long interval, perhaps once a day.
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
