Forum Discussion
Conny_153265
Nimbostratus
May 09, 2014Best 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....
May 16, 2014
Hi Conny!
You can actually fetch an array of pools at the same time which reduces overhead alot.
Something like this:
if ( (Get-PSSnapin | Where-Object { $_.Name -eq "iControlSnapIn"}) -eq $null ){
Add-PSSnapIn iControlSnapIn
}
$user = 'myuser'
$pass = 'mypassword'
$success = Initialize-F5.iControl -Username $user -Password $pass -HostName 1.1.1.1
$f5 = Get-F5.iControl
$PoolList = $f5.LocalLBPool.get_list()
$ActionServiceDown = $f5.LocalLBPool.get_action_on_service_down($PoolList)
$LBMethod = $f5.LocalLBPool.get_lb_method($PoolList)
for($i=0;$i -lt ($PoolList.Count);$i++){
Pool Name
$PoolList[$i]
Action on service down
$ActionServiceDown[$i]
Load balancing method
$LBMethod[$i]
}
/Patrik
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
