Forum Discussion
Getting active pool member connections using Python
The stats are pulled from the pool or member itself. Try this for an example:
!/usr/bin/env python3
from f5.bigip import ManagementRoot
from getpass import getpass
from pprint import pprint
hostname = 'my.f5.ltm.net'
username = 'foo'
mgmt = ManagmentRoot(hostname, username, getpass())
pool = mgmt.tm.ltm.pools.pool.load(name='my_pool_name')
poolstats = pool.stats.load()
pprint(poolstats.raw)
members = pool.members_s.get_collection()
member0_stats = members[0].stats.load()
pprint(member0_stats.raw)
That example was a virtual IP, but was just the example IP I had in front on me. In reality I need this for both virtual servers and pool members.
But in any case, when I use your example for pool members I get the output of the value of the number of connected clients instead of the list of client IP's connected to the pool member as I showed above. My results for that code give me:
{'value': 5}
What I need is the list of those 5 IP's that are currently connected to that pool member which I can get using the CLI command "show sys connection ss-server-addr x.x.x.x"
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