Forum Discussion
querying Pool member stats
Although the method below is not a Python code, this is how you can code.
curl -sku admin: https:///mgmt/tm/ltm/pool/stats | \ python -m json.tool | \ egrep 'selfLink\:|status\.' && date
That is;
- Connect to the BIG-IP via https using Basic Authentication.
- GET /mgmt/tm/ltm/pool/stats. To get a specific pool, /mgmt/tm/ltm/pool/.
- Parse the obtained JSON object.
-
Get the name of the pool(s) from selfLink: and their status from any of the following fields:
- status.availabilityState
- status.enabledState
- status.statusReason
-
Get the (local) timestamp.
Sample output as below:selfLink: 'https://localhost/mgmt/tm/ltm/pool/stats?ver=11.6.1', selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~HTTP-All/stats?ver=11.6.1', 'status.availabilityState': { description: 'available' }, 'status.enabledState': { description: 'enabled' }, 'status.statusReason': { description: 'The pool is available' }, selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~HTTP-CentOS-vmnet2/stats?ver=11.6.1', 'status.availabilityState': { description: 'offline' }, 'status.enabledState': { description: 'enabled' }, 'status.statusReason': { description: 'The children pool member(s) are down' }, selfLink: 'https://localhost/mgmt/tm/ltm/pool/~Common~HTTP-CentOS-vmnet2-Node/stats?ver=11.6.1', 'status.availabilityState': { description: 'available' }, 'status.enabledState': { description: 'enabled' }, 'status.statusReason': { description: 'The pool is available' }, Mon Aug 7 10:15:44 NZST 2017
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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