Forum Discussion
4 Replies
Sort By
- 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:
- wayney_128269NimbostratusDo you have any sample code that enumerations current connections?
- 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.
- 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); }