Forum Discussion
Tim_Harber
Jun 05, 2018Cirrus
Getting 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
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)
Jason_Nance_333
Jun 06, 2018Cirrus
You're saying pool member but
cs-server-addr
is virtual server.
If you want connections to the virtual server use:
virtual = mgmt.tm.ltm.pools.pool.load(name='my_vs_name')
vsstats = virtual.stats.load()
If you want pool member stats they are in the
member0_stats = members[0].stats.load()
example above (you will need to iterate the pool members) -
member0_stats.entries['serverside.curConns']
.
Here's a graphical breakdown of the various cs/ss arguments:
https://wtit.com/view-delete-f5-load-balancer-active-connections/
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