Forum Discussion
Eugene_Reznik_1
Oct 24, 2013Nimbostratus
Even if you have switched to the correct partition you still need to specify the partition for both the server and the pool in your code.
(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/SERVER_NAME"
$address.port = 666;
$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"
}
}
- ZdendaOct 24, 2013CirrusAh, you was quicker then me, I noticed it's missing in the code above by mistake. Now there is actuall code, error is the same