Forum Discussion
OTS02
Cirrus
Feb 02, 2009show current connections with VB
Could someone provide me with a example of how to show current connections for a particular pool member in VB?
Thanks
13 Replies
- OTS02
Cirrus
OK, I see that "new" should not be capitalized, but am still having trouble getting this thing off the ground. - You need to declare your MemberStatisticEntry as a 2-d array per the API definition. Also, the first parameter needs to be an array of pool names. This code should work for you:
public UInt64 build64(iControl.CommonULong64 ul64) { return (UInt64)((UInt64)(ul64.high << 32) | (UInt64)ul64.low); } public void getPoolMemberStatistics(string pool, string memberaddr, int memberport) { string [] pool_names = new string[] { pool }; iControl.CommonIPPortDefinition[][] members = new iControl.CommonIPPortDefinition[1][]; members[0 ] = new iControl.CommonIPPortDefinition[1]; members[0][0] = new iControl.CommonIPPortDefinition(); members[0][0].address = memberaddr; members[0][0].port = memberport; iControl.LocalLBPoolMemberMemberStatistics [] stats = m_interfaces.LocalLBPoolMember.get_statistics(pool_names, members); //Loop over the pools for (int i=0; i { Console.WriteLine("Pool: {0}", pool_names[ i ]); // Loop over the pool members for each pool for (int j = 0; j < stats[ i ].statistics.Length; j++) { Console.WriteLine(" Member -> {0}:{1}", stats[ i ].statistics[ j ].member.address, stats[ i ].statistics[ j ].member.port.ToString()); for(int k=0; k < stats[ i ].statistics[ j ].statistics.Length; k++) { Console.WriteLine(" {0} -> {1}", stats[ i ].statistics[ j ].statistics[ k ].type.ToString(), build64(stats[ i ].statistics[ j ].statistics[ k ].value).ToString()); } } } }
- OTS02
Cirrus
Thank you so much 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