For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Martin_B__246_r's avatar
Martin_B__246_r
Icon for Nimbostratus rankNimbostratus
May 05, 2014

List poolmembers that are down,unavailable and Unknown

Hi, Im writing a simple GUI in powershell studio that displays poolmember status. I'm having difficulties writing conditional logic so that the application only list poolmembers that are not available. I've looked at Joe's 'LocalTrafficSummary.ps1' but i want to know which poolmembers that are offline, disabled etc.

 

$pools = Get-F5.LTMPool | Select -ExpandProperty Name
$poolmembers = foreach($pool in $pools) { Get-F5.LTMPoolMember -Pool $pool }

 

This seems to work bu if i want to include Unavailable and Unknown, how do i write that code? $poolmembers | Where-Object {$_.Availability -eq 'AVAILABILITY_STATUS_RED'}

thanks!

4 Replies

  • So, if you look for any others with "-ne"?? $poolmembers | Where-Object {$_.Availability -ne 'AVAILABILITY_STATUS_GREEN'}
  • Since you are using the value of "Availability", you can do the following: add the operator "-or" like:

     

    $poolmembers | Where-Object {$_.Availability -eq 'AVAILABILITY_STATUS_RED' -or $_.Availability -eq 'AVAILABILITY_STATUS_BLUE'}

     

    or just filter any different like: $poolmembers | Where-Object {$_.Availability -ne 'AVAILABILITY_STATUS_GREEN'}

     

    Is this what you want?

     

  • Hi, yes i tried that, is this the best way? All i sant To dom is display pools & poolmembers that are not available.

     

  • Well, I'm not expert, but, if you will store only members that are not in "available green status", maybe I would made the filter on the same command line. I think you are on the correct way.