perl 获取F5 pool的并发数

use BigIP::iControl;
use Data::Dumper;
my $ic = BigIP::iControl->new(
server => '1.1.11',
username => 'dd',
password => '12345678',
port => '443',
proto => 'https'
);
##获取所有定义的LTM 虚拟机服务器
my $i=0;
my $pool='/Common/ESB_pool';
#Returns a list of the pool members for the specified LTM pool. This method takes one mandatory parameter; the name of the pool.
#
#Pool member are returned in the format IP_address:service_port.
#返回指定的LTM pol的 成员列表,这个方法需要一个参数 pool的名字
my @member=$ic->get_ltm_pool_members($pool);
print @member;
print "
";
#Returns a hash containing all pool statistics for the specified pool in a delicious, easily digestable and improved formula.
#返回指定poold的所有的pool的统计信息,返回hash
my %stats = $ic->get_pool_statistics_stringified ($pool);
print %stats;
print "
";
print '-----------遍历%stats--------------'."
"; 
print "
";
foreach $key (keys %stats) {
  print  "$key=>$stats{$key}
";
  if ($key eq 'stats'){
       my %h1 = %{$stats{$key}};
       foreach $key (sort keys %h1){
           print "$pool=>$key=>$h1{$key}
"
       };
   };
};
原文地址:https://www.cnblogs.com/hzcya1995/p/13348975.html