I am attempting to modify the PoolMemberControl script to run at the Node Level.
I have with the help of these forums and documentation figured out the Set_Session_Enabled_State and Set_Monitor_Status pieces.
However now I am attempting to use the Connection Bleed loop and I keep getting the following error. I know I am close… any help would be appreciated.
Unable to index into an object of type iControl.LocalLBNodeAddressNodeAddressStatistics.
At S:\Technology\Technical Services\Scripting Resources\iControl\Scripts\DisableNode.ps1:92 char:46
+ $MemberStatisticEntry = $MemberStatisticsA[0 <<<< ].statistics();
Here is my loop
$cur_connections = 1;
while ($cur_connections -gt 0)
{
$MemberStatisticsA =
(Get-F5.iControl).LocalLBNodeAddress.get_statistics($NodeAddresses);
$MemberStatisticEntry = $MemberStatisticsA[0].statistics();
$Statistics = $MemberStatisticEntry.statistics;
foreach ($Statistic in $Statistics)
{
$type = $Statistic.type;
$value = $Statistic.value;
if ($type -eq “STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS”)
{
$cur_connections = $value.low;
Write-Host “Current Connections: $cur_connections”
}
}
Start-Sleep -s 1
}