Forum Discussion

9 Replies

  • hello,

    you can use curl to get the pool stats :

    curl -k -X GET https://bigip/mgmt/tm/ltm/pool/~Common~test_pool/stats

    Here what I get on my lab :

    {"kind":"tm:ltm:pool:poolstats","generation":1,"selfLink":"","entries":{"activeMemberCnt":{"value":0},"connqAll.ageEdm":{"value":0},"connqAll.ageEma":{"value":0},"connqAll.ageHead":{"value":0},"connqAll.ageMax":{"value":0},"connqAll.depth":{"value":0},"connqAll.serviced":{"value":0},"connq.ageEdm":{"value":0},"connq.ageEma":{"value":0},"connq.ageHead":{"value":0},"connq.ageMax":{"value":0},"connq.depth":{"value":0},"connq.serviced":{"value":0},"curSessions":{"value":0},"minActiveMembers":{"value":0},"monitorRule":{"description":"none"},"tmName":{"description":"/Common/aaa-ad-basile-pool"},"serverside.bitsIn":{"value":0},"serverside.bitsOut":{"value":0},"serverside.curConns":{"value":0},"serverside.maxConns":{"value":0},"serverside.pktsIn":{"value":0},"serverside.pktsOut":{"value":0},"serverside.totConns":{"value":0},"status.availabilityState":{"description":"unknown"},"status.enabledState":{"description":"enabled"},"status.statusReason":{"description":"The children pool member(s) either don't have service checking enabled, or service check results are not available yet"},"totRequests":{"value":0}}}

  • f5-sdk 2.2.0 ; Python v3.4.3 ; BigIP 11.5.4

    from f5.bigip import ManagementRoot
    
    def get_pool_stats(p_name, p_partition):
        """Return all pool stats object (dict of dicts)"""
        pool = API_ROOT.tm.ltm.pools.pool.load(name=p_name, partition=p_partition)
        return pool.stats.load()
    
    API_ROOT = ManagementRoot("bip-01", "admin", "admin")
    POOL_STATS = get_pool_stats('pool_somepool', 'Common')
    
     EXAMPLES OF USE:
    
     1. Print all stats (complete dictionary of dictionaries, inclusive of irrelevant bulk)
    print(POOL_STATS.raw)
     2. Print all stats (entries dictionary - all key/value pairs of actual stats)
    print(POOL_STATS.entries)
     3. Print a specific extraction from entries dictionary
    print(POOL_STATS.entries.get('curSessions'))
     4. Print a specific extraction from entries dictionary (just value of a specific key)
    print(POOL_STATS.entries.get('curSessions')['value'])
    

    Regards,

  • f5-sdk 2.2.0 ; Python v3.4.3 ; BigIP 11.5.4

    from f5.bigip import ManagementRoot
    
    def get_pool_stats(p_name, p_partition):
        """Return all pool stats object (dict of dicts)"""
        pool = API_ROOT.tm.ltm.pools.pool.load(name=p_name, partition=p_partition)
        return pool.stats.load()
    
    API_ROOT = ManagementRoot("bip-01", "admin", "admin")
    POOL_STATS = get_pool_stats('pool_somepool', 'Common')
    
     EXAMPLES OF USE:
    
     1. Print all stats (complete dictionary of dictionaries, inclusive of irrelevant bulk)
    print(POOL_STATS.raw)
     2. Print all stats (entries dictionary - all key/value pairs of actual stats)
    print(POOL_STATS.entries)
     3. Print a specific extraction from entries dictionary
    print(POOL_STATS.entries.get('curSessions'))
     4. Print a specific extraction from entries dictionary (just value of a specific key)
    print(POOL_STATS.entries.get('curSessions')['value'])
    

    Regards,