Forum Discussion
Tim_Harber
Cirrus
Jun 05, 2018Getting active pool member connections using Python
If I want to see all of the client connections connecting to a pool member from the CLI I can do something like a "show sys connection ss-server-addr 1.2.3.4". I can also do this using Postman mappi...
Jason_Nance_333
Cirrus
Jun 06, 2018The 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)
Tim_Harber
Cirrus
Jun 06, 2018Thanks Jason. I am able to get stats the way you describe, but what I am trying to get is the actual connected clients connected to each pool member. For example from the CLI if I do a
show sys connection cs-server-addr 10.69.67.92
I get the following resuts:'
Sys::Connections
192.168.181.163:51952 10.69.67.92:443 10.69.67.15:4822 10.69.65.65:44301 tcp 3 (tmm: 10) none
192.168.181.160:62556 10.69.67.92:443 10.69.67.15:21454 10.69.65.64:44301 tcp 2 (tmm: 10) none
10.74.10.114:60012 10.69.67.92:443 10.69.67.15:4246 10.69.65.65:44301 tcp 11 (tmm: 11) none
192.168.181.162:57199 10.69.67.92:443 10.69.67.15:32841 10.69.65.63:44301 tcp 2 (tmm: 6) none
192.168.181.156:58295 10.69.67.92:443 10.69.67.15:57537 10.69.65.64:44301 tcp 1 (tmm: 1) none
10.69.53.175:52661 10.69.67.92:443 10.69.67.15:57967 10.69.65.63:44301 tcp 10 (tmm: 7) none
Total records returned: 6
I am trying to get this same data using the API. I can get it via REST using Postman, but cannot figure out how to do it using Python.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
