20-May-2021 01:37
I would like to get the status of the pool and web servers [online/offline] via rest API. I’ve gone through the API documentation but couldn’t figure out what should be my API call.
Can someone here please help?
Solved! Go to Solution.
21-May-2021 02:20
Hi,
Have you seen this one? https://devcentral.f5.com/s/question/0D51T00006i7Yj4/icontrol-rest-getting-pool-member-status
Basically, this should be your curl request (change the name of the pool/IP and add user/pass):
curl --request GET --url 'https://192.168.10.31/mgmt/tm/ltm/pool/~Common~wiki-pool/members/stats'
21-May-2021 02:20
Hi,
Have you seen this one? https://devcentral.f5.com/s/question/0D51T00006i7Yj4/icontrol-rest-getting-pool-member-status
Basically, this should be your curl request (change the name of the pool/IP and add user/pass):
curl --request GET --url 'https://192.168.10.31/mgmt/tm/ltm/pool/~Common~wiki-pool/members/stats'
22-May-2021
23:05
- last edited on
24-Mar-2022
01:09
by
li-migration
Thanks , I am able to use this to get a response.
In the API response, I am assuming the key "monitorStatus" indicates whether the member is down or up, is this correct?
23-May-2021 03:09
That's correct.
If you look a bit further down in the response, you can also find these entries;
"sessionStatus": {
"description": "user-disabled"
},
"status.availabilityState": {
"description": "offline"
},
"status.enabledState": {
"description": "disabled"
},
"status.statusReason": {
"description": "Forced down"
This is showing you if the member is administratively down (Disabled / Forced Offline) - the example above is showing it with Forced Offline configured.
If you're happy with the answer. Would be great if you can flag the item as "Answered" so it can be closed and may benefit the rest of the community.
22-May-2021 23:18
Also, how can I check if a virtual server is up/down via rest call?
23-May-2021 03:05
Basically anything can be found via iControl, but can be a bit of a search at first. Anything to do with virtual servers, can be found under /mgmt/tm/ltm/virtual (the structure is very similar to TMSH commands). Have a look here for the full guide and setup required for any iControl requests;
https://clouddocs.f5.com/api/icontrol-rest/
Whenever I need to build any iControl commands, I use these pages to reference material.