Forum Discussion
Eugene_Reznik_1
Oct 24, 2013Nimbostratus
I was able to figure out the issue. It had to do with using a none Common partition.
This code works
(Get-F5.iControl).ManagementPartition.set_active_partition( (,"PARTITION_NAME") )
Write-Host (Get-F5.iControl).ManagementPartition.get_active_partition() -ForegroundColor Yellow
$address = New-Object -TypeName iControl.CommonAddressPort;
$address.address ="/PARTITION_NAME/SERVE_RNAME"
$address.port = 666;
$state = New-Object -TypeName "iControl.CommonEnabledState"
$state = "STATE_DISABLED";
(Get-F5.iControl).LocalLBPool.set_member_monitor_state( (, $pool_name), $address,(,$state));
Write-Host "Waiting for current connections to drop to zero..." -ForegroundColor Yellow;
$MemberStatisticsA = (Get-F5.iControl).LocalLBPool.get_member_statistics( ("/PARTITION_NAME/POOL_NAME"), $address);
$MemberStatisticEntry = $MemberStatisticsA[0].statistics[0];
$Statistics = $MemberStatisticEntry.statistics;
foreach ($Statistic in $Statistics)
{
$type = $Statistic.type;
$value = $Statistic.value;
if ( $type -eq "STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS" )
{
just use the low value. Odds are there aren't over 2^32 current connections.
If your site is this big, you'll have to convert this to a 64 bit number.
$cur_connections = $value.low;
Write-Host "Current Connections: $cur_connections"
}
}