Forum Discussion
Can a Health Monitor tell a server's 'ping' page about the F5's status?
- Apr 18, 2022
About 10mins after I posted my question, I discovered iControlREST: https://clouddocs.f5.com/api/icontrol-rest/!
If allows:
[root@bigip:Active:Standalone] x # curl --silent --insecure --user admin:xxx https://localhost:8443/mgmt/tm/ltm/ pool/"~Common~mypool"/members/stats | jq -c '[( .entries[].nestedStats.entries | { address:.addr.description, port:.port.v alue, curSessions:."serverside.curConns".value, state:.monitorStatus.description })]' [{"address":"192.168.1.3","port":8443,"curSessions":0,"state":"down"},{"address":"192.168.1.3","port":8543,"curSessions":0,"state":"user-down"},{"address":"192.168.1.3","port":8643,"curSessions":0,"state":"user-down"},{"address":"192.168.1.3","port":8743,"curSessions":0,"state":"user-down"},{"address":"192.168.1.100","port":8080,"curSessions":0,"state":"down"}]
Having curl and jq work together is simple and powerful.
This appears to be just what I need...easy to wrap into a bash script that I can set as an external monitor.
I now have a pretty small bash script that takes the JSON above and passes it in the body of a POST to my app's ping endpoint.
I hope it is performant enough for The Small Gods of the F5 to accept it for PROD use. Should be. We will see...
I accumulated some useful references...happy to share:
useful refs:
https://clouddocs.f5.com/api/icontrol-rest/APIRef_tm_ltm.htmlhttps://support.f5.com/csp/article/K17283308
https://support.f5.com/csp/article/K71282813
https://community.f5.com/t5/tag/series-icontrol-rest-jq-cookbook/tg-p
https://community.f5.com/t5/tag/series-demystifying-icontrol-rest/tg-p/board-id/TechnicalArticles
https://programminghistorian.org/en/lessons/json-and-jq
https://cdn.f5.com/websites/devcentral.f5.com/downloads/icontrol-rest-api-user-guide-15-1-0.pdf
There's some really Good Stuff there...very helpful.
Cheers!
About 10mins after I posted my question, I discovered iControlREST: https://clouddocs.f5.com/api/icontrol-rest/!
If allows:
[root@bigip:Active:Standalone] x # curl --silent --insecure --user admin:xxx https://localhost:8443/mgmt/tm/ltm/
pool/"~Common~mypool"/members/stats | jq -c '[( .entries[].nestedStats.entries | { address:.addr.description, port:.port.v
alue, curSessions:."serverside.curConns".value, state:.monitorStatus.description })]'
[{"address":"192.168.1.3","port":8443,"curSessions":0,"state":"down"},{"address":"192.168.1.3","port":8543,"curSessions":0,"state":"user-down"},{"address":"192.168.1.3","port":8643,"curSessions":0,"state":"user-down"},{"address":"192.168.1.3","port":8743,"curSessions":0,"state":"user-down"},{"address":"192.168.1.100","port":8080,"curSessions":0,"state":"down"}]
Having curl and jq work together is simple and powerful.
This appears to be just what I need...easy to wrap into a bash script that I can set as an external monitor.
I now have a pretty small bash script that takes the JSON above and passes it in the body of a POST to my app's ping endpoint.
I hope it is performant enough for The Small Gods of the F5 to accept it for PROD use. Should be. We will see...
I accumulated some useful references...happy to share:
useful refs:
https://clouddocs.f5.com/api/icontrol-rest/APIRef_tm_ltm.html
https://support.f5.com/csp/article/K17283308
https://support.f5.com/csp/article/K71282813
https://community.f5.com/t5/tag/series-icontrol-rest-jq-cookbook/tg-p
https://community.f5.com/t5/tag/series-demystifying-icontrol-rest/tg-p/board-id/TechnicalArticles
https://programminghistorian.org/en/lessons/json-and-jq
https://cdn.f5.com/websites/devcentral.f5.com/downloads/icontrol-rest-api-user-guide-15-1-0.pdf
There's some really Good Stuff there...very helpful.
Cheers!
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