Forum Discussion

6 Replies

  • Hi Azam89

     

    You could try this.

     

    tmsh list ltm pool one-line | grep ''

     

  • Hi Azam89

     

    You could try this.

     

    tmsh list ltm pool one-line | grep ''

     

  • That should be

     

    tmsh list ltm pool one-line | grep ''

     

     

    • Stewart_88212's avatar
      Stewart_88212
      Icon for Nimbostratus rankNimbostratus
      Sorry, I don't have experience with the Powershell iControl snapin.
  • Here's some code that may help for PowerShell iControl... Just replace the server address with the right ip/hostname and update the nodeToFind variable. It's a little wordy, but I think it'll accomplish what you're looking for. (Could be wrapped as a function as well to make it easier)

     

     Connect to the BIG-IP
    $creds  = Get-Credential;
    $server = "0.0.0.0";
    $iConn  = Initialize-F5.iControl -HostName $server -Username $creds.Username -Password $creds.GetNetworkCredential().Password;
    $iCtrl  = Get-F5.iControl;
    
     Get Node Information
    $nodeNames   = @($ictrl.LocalLBNodeAddressV2.get_list());
    $nodeAddress = @($ictrl.LocalLBNodeAddressV2.get_address($nodeNames));
    $nodeList    = @();
    for ($i=0; $i -le $nodeNames.Length; $i++) {
        $nodeList += "" | Select-Object @{Name="Name";   Expression={$nodeNames[$i]}}, @{Name="Address";Expression={$nodeAddress[$i]}}
    }
     Get Pool Information
    $poolNames   = @($ictrl.LocalLBPool.get_list());
    $poolMembers = @($ictrl.LocalLBPool.get_member_v2($poolNames));
    $poolList    = @();
    for ($i=0; $i -le $poolNames.Length; $i++) {
        $poolList += "" | Select-Object @{Name="Name";   Expression={$poolNames[$i]}}, @{Name="Members";Expression={@($poolMembers[$i])}}
    }
    
     Node to find
    $nodeToFind = "10.0.1.1";  or "google.com"
    $node       = $nodeList | ?{ $_.Name -like "*$nodeToFind" -or $_.Address -like $nodeToFind };
    
     Get associated pools
    $poolList | ?{ $_.Members | ?{ $_.address -eq $node.Name } }