Forum Discussion
3 Replies
Sort By
- Leonardo_SouzaCirrocumulus
I am assuming that you are talking about iControl SOAP. You can use this function:
https://devcentral.f5.com/wiki/icontrol.locallb__pool__memberstatistics.ashx
- Demeter_LuoNimbostratus
@msandeep
I and you have the same problem,I don't find the python class in github.
Now you find it?
Thanks D.Luo
- Satoshi_Toyosa1Employee
Please refer to F5 Python SDK Documentation for the iControl REST Python interface documentation.
The sample code below is not optimal but does something similar to tmsh show ltm pool members.
from f5.bigip import ManagementRoot mgmt = ManagementRoot('192.168.0.10', 'admin', 'admin') pool = mgmt.tm.ltm.pools.pool.load(name='CentOS-all-80', partition='Common') members = pool.members_s.get_collection() for member in members: stat = member.stats.load().raw url1 = stat['selfLink'] url_nover = url1.split('?')[0] remove the 'ver=x.x.x' url_dirs = url_nover.split('/') break into path segments url_dirs.insert(-2, url_dirs[-2]) add extra object url2 = '/'.join(url_dirs) print url2 nestedStatsEntries = stat['entries'][url2]['nestedStats']['entries'] for key, value in nestedStatsEntries.iteritems(): print '\t{} = {}'.format(key, value)