Forum Discussion
S_Griesmyer_156
Nimbostratus
May 21, 2014Can't get Global LB Pool Member Availability
I'm trying to modify the Powershell code in the codeshare https://devcentral.f5.com/wiki/icontrol.powershellpoolmemberavailability.ashx to pull GTM Pool Member availability. When I switch out the Loc...
- May 21, 2014
I find that it is usually easiest to get the data from the F5 itself. I'll use each control until I build up a full set of data.
Sorry for the psudocode, but it looks like
pools = GlobalLB.get_pools()
pool_members = GlobalLB.get_pool_members(pools)
pool_member_status = GlobalLB.get_pool_member_status(pools, pool_members)
Brent_West_7733
May 21, 2014Historic F5 Account
I find that it is usually easiest to get the data from the F5 itself. I'll use each control until I build up a full set of data.
Sorry for the psudocode, but it looks like
pools = GlobalLB.get_pools()
pool_members = GlobalLB.get_pool_members(pools)
pool_member_status = GlobalLB.get_pool_member_status(pools, pool_members)
S_Griesmyer_156
Nimbostratus
May 22, 2014Thank you very much! Here's the final code block I put together based on your recommendations...
ForEach ($pool in $pools){
$ht = [ordered]@{}
$poolmembers = (Get-F5.iControl).GlobalLBPool.get_member($pool)
ForEach ($member in $poolmembers.member){
$memberstatus = (Get-F5.iControl).GlobalLBPoolMember.get_object_status($pool,$member)
$ht.pool = $pool
$ht.member_ip = $member.address.tostring()
$ht.member_name = [System.Net.Dns]::GetHostEntry($member.address.tostring()).HostName
$ht.port = $member.port
$ht.availability_status = $memberstatus.status.availability_status
$ht.enabled_status = $memberstatus.status.enabled_status
$ht.status_description = $memberstatus.status.status_description
$tmp = New-Object PSObject -Property $ht
$table += $tmp
}
}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