Forum Discussion
3 Replies
- Satoshi_Toyosa1
Employee
Unfortunately, there is no iControl REST call to get the pool stats from all the partitions in one shot. The underlying tmsh command, 'tmsh show ltm pool members' only reports the members under the current partition and does not provide any option to specify different partition(s). A workaround is:
1) Obtain a list of pools. GET /mgmt/tm/ltm/pool gives you all the pools irrespective of partitions.
2) Obtain the stats one by one: GET /mgmt/tm/ltm/pool/<pool>/stats.
This is my sample code using F5 Python SDK.
from f5.bigip import ManagementRoot # Dump the object recursively def recurse(dictionary, level): for key, value in dictionary.iteritems(): if isinstance(value, dict): print('{}{}:'.format(' '*level, key)) recurse(value, level+1) else: print('{} {} : {}'.format(' '*level, key, value)) mgmt = ManagementRoot('myHost, "myadmin", "myadminpasswd", debug=True) pools = mgmt.tm.ltm.pools.get_collection() print("Total pools: %-10s" % (len(pools))) for pool in pools: stat = pool.stats.load().__dict__['entries'] recurse(stat, 0)
- Naman
Altostratus
Thanks for your comment, Getting All one by one will be resource intensive, suppose any device has 5000 pools, Then ill be making 5000 calls to get pool and members details.
it creates problem on resources, cpu and memory spiked.
- Jeremy_Jeldo
Nimbostratus
Is there any alternative method to get all the pools and their members stats in a single API call?
I tried by dong a SNMP bulk walk but the names are getting truncated as mentioned here.
did you implement with bulk API calls as you solution?
Thanks.