Forum Discussion
rathid
Nimbostratus
Aug 03, 2017querying Pool member stats
Hi all,
do we have a python script which can call each pool member availibilty stat with time stamp and current connect. need pure python code. any help is appreciated !!!!
Ed_Summers
Nimbostratus
Aug 08, 2017Rathid - I saw your post in my other topic. Sorry for the delay - it has been a very busy week.
Below is some sample code to pull availability status and current connections for members of a particular pool. With a bit of basic knowledge on the SDK you should be able to expand this to get other statistics as needed. Of course, replace any text in <> below with actual values for your environment. Hopefully this provides enough information to build upon for your specific need.
from f5.bigip import ManagementRoot
from f5.utils.responses.handlers import Stats
host_ip =
username =
password =
Use token auth if BIG-IP uses an external authentication service
mgmt = ManagementRoot(host_ip, username, password, token=True)
my_pool = mgmt.tm.ltm.pools.pool.load(partition='Common', name='')
my_pool_mbrs = my_pool.members_s.get_collection()
for pool_mbr in my_pool_mbrs:
mbr_stats = Stats(pool_mbr.stats.load())
print(mbr_stats.stat.status_availabilityState)
print(mbr_stats.stat.serverside_curConns)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