Forum Discussion
4 Replies
- DevBabuCirrus
I was trying to get the statistics for the following type:
STATISTIC_SSL_PROTOCOL_SSLV2 STATISTIC_SSL_PROTOCOL_SSLV3
Is that ever implemented because I do not get those type back.
code:
def get_virtual_statistics(obj, virtual): try: statistics = obj.LocalLB.VirtualServer.get_statistics([virtual]) return statistics except Exception, e: print e
I only see the following type returned:
STATISTIC_MINIMUM_CONNECTION_DURATION STATISTIC_MEAN_CONNECTION_DURATION STATISTIC_MAXIMUM_CONNECTION_DURATION STATISTIC_NO_NODE_ERRORS STATISTIC_CLIENT_SIDE_BYTES_IN STATISTIC_CLIENT_SIDE_BYTES_OUT STATISTIC_CLIENT_SIDE_PACKETS_IN STATISTIC_CLIENT_SIDE_PACKETS_OUT STATISTIC_CLIENT_SIDE_CURRENT_CONNECTIONS STATISTIC_CLIENT_SIDE_MAXIMUM_CONNECTIONS STATISTIC_CLIENT_SIDE_TOTAL_CONNECTIONS STATISTIC_PVA_CLIENT_SIDE_BYTES_IN STATISTIC_PVA_CLIENT_SIDE_BYTES_OUT STATISTIC_PVA_CLIENT_SIDE_PACKETS_IN STATISTIC_PVA_CLIENT_SIDE_PACKETS_OUT STATISTIC_PVA_CLIENT_SIDE_CURRENT_CONNECTIONS STATISTIC_PVA_CLIENT_SIDE_MAXIMUM_CONNECTIONS STATISTIC_PVA_CLIENT_SIDE_TOTAL_CONNECTIONS STATISTIC_EPHEMERAL_BYTES_IN STATISTIC_EPHEMERAL_BYTES_OUT STATISTIC_EPHEMERAL_PACKETS_IN STATISTIC_EPHEMERAL_PACKETS_OUT STATISTIC_EPHEMERAL_CURRENT_CONNECTIONS STATISTIC_EPHEMERAL_MAXIMUM_CONNECTIONS STATISTIC_EPHEMERAL_TOTAL_CONNECTIONS STATISTIC_VIRTUAL_SERVER_SYNCOOKIE_HW_INSTANCES STATISTIC_VIRTUAL_SERVER_SYNCOOKIE_SW_INSTANCES STATISTIC_VIRTUAL_SERVER_SYNCOOKIE_CACHE_USAGE STATISTIC_VIRTUAL_SERVER_SYNCOOKIE_CACHE_OVERFLOWS STATISTIC_VIRTUAL_SERVER_SYNCOOKIE_SW_TOTAL STATISTIC_VIRTUAL_SERVER_SYNCOOKIE_SW_ACCEPTS STATISTIC_VIRTUAL_SERVER_SYNCOOKIE_SW_REJECTS STATISTIC_VIRTUAL_SERVER_SYNCOOKIE_HW_TOTAL STATISTIC_VIRTUAL_SERVER_SYNCOOKIE_HW_ACCEPTS STATISTIC_TOTAL_REQUESTS STATISTIC_TOTAL_PVA_ASSISTED_CONNECTIONS STATISTIC_CURRENT_PVA_ASSISTED_CONNECTIONS STATISTIC_VIRTUAL_SERVER_TOTAL_CPU_CYCLES STATISTIC_VIRTUAL_SERVER_FIVE_SEC_AVG_CPU_USAGE STATISTIC_VIRTUAL_SERVER_ONE_MIN_AVG_CPU_USAGE STATISTIC_VIRTUAL_SERVER_FIVE_MIN_AVG_CPU_USAGE STATISTIC_ACL_NO_MATCH
- That topic was just updated and was greatly expanded in the latest release so it could be taxing our wiki system processing it. I'll look at it and get it fixed by tomorrow. Sorry for the inconvenience...
The topic page for Common.StatisticType should be fixed now, again sorry for the inconvenience. Keep in mind that this is just an all-inclusive list of all statistic types across all interfaces on the BIG-IP. There are over 1500 of them so the content is broken across 15 pages. Look at the bottom for an index link list that you can use to navigate across all of them.
As for your original question, that topic does not list which methods return each statistic. It just lists them out with the description for that statistic type. We currently do not have a detailed list of which statistics are returned for each method. You will have to query the interface and see which stats are returned in real time. I'll see what I can do to get those mappings but that will likely be a pretty significant effort. I'll keep you posted if/when I have that solution.
Hope this helps...
-Joe
- DevBabuCirrus
Thanks JOE. Indeed it was an effort, finally I found the SSL statistics in
LocalLB.ProfileClientSSL.get_statistics_by_virtual
I have written a script to get SSL traffic statistics. Hope this helps if they are considering to upgrade to 11.5.x or higher or find the clientssl profile being used in the virtual server.
def get_virtuals(obj): try: return obj.LocalLB.VirtualServer.get_list() except Exception, e: print e def get_virtual_profiles(obj): try: virtual = get_virtuals(obj) profiles = obj.LocalLB.VirtualServer.get_profile(virtual) return virtual, profiles except Exception, e: print e def get_virtual_client_ssl_statistics(obj, profile,virtual): try: statistics = obj.LocalLB.ProfileClientSSL.get_statistics_by_virtual([profile], [[virtual]]) return statistics except Exception, e: print e def return_true_types(ssl_type): allowed_types = ["STATISTIC_SSL_PROTOCOL_SSLV2", "STATISTIC_SSL_PROTOCOL_SSLV3", "STATISTIC_SSL_PROTOCOL_TLSV1", "STATISTIC_SSL_PROTOCOL_TLSV1_1", "STATISTIC_SSL_PROTOCOL_TLSV1_2"] if ssl_type in allowed_types: return True if __name__ == "__main__": import bigsuds import getpass import sys import os if len(sys.argv)< 3: print ("Usage %s ip_address username" % sys.argv[0]) sys.exit() a = sys.argv[1:] print ("\nHey %s, please enter your password below.\n" %a[1]) upass = getpass.getpass() try: b = bigsuds.BIGIP( hostname = a[0], username = a[1], password = upass, ) except Exception, e: print (e) Files file_name = a[0] +".csv" path_to_folder= os.getcwd() path_to_file = path_to_folder +"/"+ file_name if (os.path.isdir(path_to_folder)): if(os.path.exists(path_to_file)): try: os.remove(path_to_file) data_file = open(path_to_file, 'a') except Exception, e: print (e) else: data_file = open(path_to_file, 'a') virtual, profiles = get_virtual_profiles(b) combined = zip(virtual, profiles) for x in combined: for y in x[1]: if y["profile_type"] == "PROFILE_TYPE_CLIENT_SSL": clientssl_profile = y["profile_name"] print x[0] + " " + clientssl_profile data_file.write(x[0] + ",") data_file.write(clientssl_profile + ",") print "=============================" statistics = get_virtual_client_ssl_statistics(b, clientssl_profile, x[0]) for iter in statistics["statistics"][0][0]: if return_true_types(iter["type"]): data_file.write(str(iter["value"]["high"]) + "," + str(iter["value"]["low"]) + ",") print iter["type"] + " " + str(iter["value"]["high"]) + " " + str(iter["value"]["low"]) data_file.write("\n")