Forum Discussion
Ray_Morris_7896
Nimbostratus
Aug 02, 2006get_member_statistics example
Hello,
The SDK gives good examples of how to use ITCMLocalLBPool, but there is no example for the gathering of statistics for pool members (it only shows pool stats and I can find no other r...
Aug 02, 2006
Do you need to request a specific pool member to get the statistics on? It is probabaly easier to use the ITCMLocalLB::Pool::get_all_member_statistics() that takes as input a pool name and will return a list of all MemberStatisticEntry structures with the member's IPPortDefinition as well as the statistics.
This isn't tested but it should get you started.
$soapResponse = $Pool->get_all_member_statistics(
SOAP::Data->name(pool_name => "my_pool")
);
@MemberStatisticsEntryList = @{$soapResponse};
print "Pool my_pool\n";
foreach $MemberStatisticEntry (@MemberStatisticsEntryList)
{
$IPPortDefinition = $MemberStatisticsEntry->{"member_definition"}
$addr = $IPPortDefinition->{"address"};
$port = $IPPortDefinition->{"port"};
print " member: $addr:$port\n";
$stats = $MemberStatisticsEntry->{"stats"};
$thruput_stats = $stats->{"thruput_stats"};
$bits_in = $thruput_stats->{"bits_in"};
...
print " bits_in: $bits_in\n";
$connection_stats = $stats->{"connection_stats"};
$current_connections = $connection_stats->{"current_connections"};
...
print " cur_con: $current_connections\n";
}If you need to use the get_member_statistics() method, you'll have to build up an array of structures containing address and values
$IPPortDefinition = {
address => "10.10.10.10",
port => 80
};
push @MemberDefList, $IPPortDefinition
$soapResponse = $Pool->get_member_statistics(
SOAP::Data->name(pool_name => "my_pool"),
SOAP::Data->name(member_defs => [@MemberDefList])
);
...Hope this helps...
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects