Forum Discussion
fetch connection statistics of pool member from f5 python sdk
is there a f5 python sdk collection/resource to get the connection statistics of pool member? which class we need to use to fetch statistics of pool member
3 Replies
- Leonardo_Souza
Cirrocumulus
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_Luo
Nimbostratus
@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_Toyosa1Ret. Employee
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)
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
