Forum Discussion
patrickmamaid_1
Nimbostratus
Dec 05, 2008number of tcp connections on a pool member
Does anyone know how to get the number of tcp connections on a pool member using iControl in java?
i'm lost in the API trying to find out
- use LocalLB.PoolMember.get_statistics() for the given pool member and look through the returned statistics for the STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS statistic.
http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=254
- patrickmamaid_1
Nimbostratus
hey Joe i'm kinda stuck trying to convert this line in java$MemberStatisticsA = (Get-F5.iControl).LocalLBPoolMember.get_statistics( (, $pool_name), $MemberDefAofA);
iControl.LocalLBPoolMember lb;
iControl.LocalLBPoolMemberMemberStatistics ms; ms.getStatistics();
- The lb.get_statistics() method should exist. Did you pass in the correct parameters (a 1-D array of pool names, and a 2-D array of pool members for each pool in the first parameter)?
- Oops, forgot that Axis1 has no direct conversion from the PortType class. You'll need to create local variables for the *PortType classes to make the method calls.
public void GetPoolMemberStats(String bigip, String username, String password, String pool_name) throws RemoteException, java.lang.Exception { iControl.Interfaces interfaces = new iControl.Interfaces(); if (interfaces.initialize(bigip, (long)443, username, password) ) { String [] pool_list = new String[] {pool_name}; iControl.LocalLBPoolMemberPortType t = interfaces.getLocalLBPoolMember(); iControl.LocalLBPoolMemberMemberStatistics [] memberStatsA = t.get_all_statistics(pool_list); for(int i=0; i { System.out.println("Pool " + pool_list[ i ]); iControl.LocalLBPoolMemberMemberStatisticEntry [] statEntryA = memberStatsA[ i ].getStatistics(); for(int j=0; j { iControl.CommonIPPortDefinition memberDef = statEntryA[j].getMember(); System.out.println("+ " + memberDef.getAddress() + memberDef.getPort()); iControl.CommonStatistic[] statisticsA = statEntryA[j].getStatistics(); for(int k=0; k { iControl.CommonStatisticType type = statisticsA[k].getType(); iControl.CommonULong64 ul64 = statisticsA[k].getValue(); long value = (long)(ul64.getHigh()<<32) + (long)ul64.getLow(); System.out.println(" " + type.toString() + " -> " + value); } } } } }
- patrickmamaid_1
Nimbostratus
this really helped! thanks Joe!
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