Forum Discussion
wayney_128269
Nimbostratus
Feb 28, 2005BigIP server connections?
Hello,
Is there a method that tells me how many connections a load balanced server has?
thanks
4 Replies
- Loc_Pham_101863Historic F5 AccountYes, there are methods that return statistics for every object type exposed by iControl. In v9.x, for example, please check out the following methods:
LocalLB
Pool::get_all_statistics
Pool::get_statistics
PoolMember::get_all_statistics
PoolMember::get_statistics
NodeAddress::get_all_statistics
NodeAddress::get_statistics
VirtualServer::get_all_statistics
VirtualServer::get_statistics
VirtualAddress::get_all_statistics
VirtualAddress::get_statistics
The stats you'd likely be interested in are:
Common::STATISTIC_SERVER_SIDE_CURRENT_CONNECTIONS
Common::STATISTIC_SERVER_SIDE_MAXIMUM_CONNECTIONS
Common::STATISTIC_SERVER_SIDE_TOTAL_CONNECTIONS
Regards,
Loc - wayney_128269
Nimbostratus
Do you have any sample code that enumerations current connections?
thanks - The SDK contains numerous examples containing statistics enumeration. Check out the ones for LocalLB NodeAddress, Pool, and VSStats. They are available in every language supported so dig down into the one of your choice. Do a grep/findstr for get_statistics and you should be set.
Also, You might want to also look at the Distribution Monitor GUI app in the SDK
[sdkroot]/sdk/samples/soap/c/microsoft/Management/DistributionMonitior
In this app, we take the raw stats and build a real-time chart with generated rates (bits/sec, etc).
-Joe - Loc_Pham_101863Historic F5 AccountHere's a snippet of C code that gets statistics for all node addresses, and prints them out to the console. You can get stats for other objects similarly.
try { Console.WriteLine("=============================================="); Console.WriteLine("Getting node address statistics..."); Console.WriteLine("------------------"); LocalLBNodeAddressNodeAddressStatistics naStatList = nodeAddressObj.get_all_statistics(); CommonTimeStamp ts = naStatList.time_stamp; Console.WriteLine("Statistics Timestamp: " + months[ts.month-1] + " " + ts.day + " " + ts.hour + ":" + ts.minute + ":" + ts.second + " " + ts.year); LocalLBNodeAddressNodeAddressStatisticEntry [] naStatistics = naStatList.statistics; for (int i = 0; i < naStatistics.Length; i++) { Console.WriteLine ("[" + i + "] Statistics for Node address: " + naStatistics[ i ].node_address); CommonStatistic [] stats = naStatistics[ i ].statistics; for (int j = 0; j < stats.Length; j++) { ulong stat = ((ulong) stats[j].value.high << 32) | (uint) stats[j].value.low; Console.WriteLine (" [" + j + "] " + stats[j].type.ToString() + ": " + stat); } } Console.WriteLine("=============================================="); } catch (System.Web.Services.Protocols.SoapHeaderException soapHdrEx) { printException(soapHdrEx); }
Hope this helps.
Loc
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
