Conny_153265
May 09, 2014Nimbostratus
Best way to list poolmembers
Hi, i have this code that gets a list of pools, then uses "Get-F5.LTMPoolMember" to get a list of poolmembers. The output looks like this:
Pool : /blablabla_pool
Address : 10.80.15.xxx
Port : 0
Name : 10.80.15.xxx:0
Availability : AVAILABILITY_STATUS_GREEN
Enabled : ENABLED_STATUS_ENABLED
Status : Pool member is available
Pool : /blablabla2_pool
Address : 10.80.7.xxx
Port : 0
Name : 10.80.7.xxx:0
Availability : AVAILABILITY_STATUS_GREEN
Enabled : ENABLED_STATUS_ENABLED
Status : Pool member is available
My problem is that it takes almost 1,5 minute to generate the list, so i'm guessing that there's something wrong with my code. That part of the code looks like this:
function Get-Pools()
{
(Get-F5.iControl).LocalLBPool.get_list();
}
----------------------------------------------------------------------------
$pools = Get-Pools
$poolmembers = foreach($pool in $pools) { Get-F5.LTMPoolMember -Pool $pool }
$poolmembers
Would appreciate some help!