Forum Discussion
Can'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 LocalLBPoolmember property to GlobalLBPoolMember, I get an error "cannot find an overload for get_object_status".
What am I missing?
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)
4 Replies
- Brent_West_7733Historic F5 Account
The data structure is different in the query:
LTM pool member statusIn GTM you need to format the query with {[Pool name], {[IP],[PORT]}}
In LTM you simply provide {[pool name]} - S_Griesmyer_156
Nimbostratus
@Brent West - Thanks for the info! Now my problem seems to be in how I provide the pool member... I try to build the {[IP],[PORT]} manually as an iControl.CommonIPPortDefinition and pass it in, but I still can't seem to get it to line up. ` $tmp = New-object iControl.CommonIPPortDefinition $tmp.address = $pool[0].address $tmp.port = $pool[0].port ` I've also tried pulling the members raw into the tmp variable... ` $tmp = (Get-F5.iControl).GlobalLBPool.get_member((,$Pool)); ` So that I could address the nodes individually...neither seem to work as I get the same results. ` PS C:> (Get-F5.iControl).GlobalLBPoolMember.get_object_status(($pool,$tmp[0].member[0])) Cannot find an overload for "get_object_status" and the argument count: "1". At line:1 char:1 + (Get-F5.iControl).GlobalLBPoolMember.get_object_status(($pool,$tmp[0].member[0]) ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodException + FullyQualifiedErrorId : MethodCountCouldNotFindBest ` - Brent_West_7733Historic 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
Thank 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
* 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