Forum Discussion
GET all pool /mgmt/tm/ltm/pool/members/stats, but the Partition outside of Common cannot be obtained
1. Get all configuration through API instead of a specific Pool. (https://1.1.1.1/mgmt/tm/ltm/pool/members/stats)
2.This can only obtain Common Partition, and other Partitions cannot be obtained. Obtaining each API separately incurs too much performance overhead on the device (https://1.1.1.1/mgmt/tm/ltm/pool/members/stats)
3.Alternatively, it can support obtaining Pool Members for a specific Partition.
4. Can URLs support adding parameters, such as https://1.1.1.1/mgmt/tm/ltm/pool/members/stats?partition=aaa But? partition=aaa parameter not valid.
long_zhao code from the live session: https://community.f5.com/t5/codeshare/collect-all-partition-pool-member-stats-with-tmsh/ta-p/315506
We were able to collect pool member stats (just bits-in/out and pkts-in/out, but you can add the others you care about) from all pool members in multiple partitions via tmsh script and then download via python.
- JRahmAdmin
Hi long_zhao,
There is no way to get all the stats for all partitions (see https://community.f5.com/t5/technical-forum/f5-icontrol-rest-api-to-get-state-and-status-of-all-ltm-gtm-pool/m-p/272649) from iControl REST. However, two options for you:
- if you use the SOAP interface, which is deprecated but still works, you can pass all pools to the get_all_member_statistics method and will get them in bulk.
- You can build an iControl LX package (like the automation toolchain) which will do all the work for you on BIG-IP and you can just pass requests and it will return all the data.
- JRahmAdmin
long_zhao another option I'm noodling on is running a tmsh script locally on BIG-IP that will write to a file that you can then download via the REST interface in a single call. This is more steps than building an iControl LX package, but simpler to implement.
If you change directory to root in tmsh and then do a show /ltm pool recursive members, you'll get all the stats for pool and pool members. If you do that in a tmsh script, you can then just pull out the stats from the pools and members you need, and then write to file. I'm going to do a live coding session on Friday at 9am pacific to work through this if you want to tune in, but if we solve it I'll post back here.
- JRahmAdmin
long_zhao code from the live session: https://community.f5.com/t5/codeshare/collect-all-partition-pool-member-stats-with-tmsh/ta-p/315506
We were able to collect pool member stats (just bits-in/out and pkts-in/out, but you can add the others you care about) from all pool members in multiple partitions via tmsh script and then download via python.
Here is an example :
https://192.168.88.100/mgmt/tm/ltm/pool/~Tenant_01~~Application_1~webpool/members/stats
SO the idea is the use a schema like this:
/mgmt/tm/ltm/pool/~<partition name>~<pool name>/stats
- long_zhaoNimbostratus
Thank you.
In this way, each pool requests an API interface once, and when there are many pools, the device's CPU or memory load will be high.
long_zhao - If your post was solved it would be helpful to the community to select *Accept As Solution*.
This helps future readers find answers more quickly and confirms the efforts of those who helped.
Thanks for being part of our community.
Lief
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