Forum Discussion
Direct traffic to maintenance page based on API call to external system
I would like to setup traffic redirection based on the response of an API call to an external application -
a) If the API returns "true", the traffic will need to be directed to a static maintenance page,
b) If the API returns "false", the traffic will need to be directed to the application pool, or
c) If the API call fails for some reason (e.g. the external app is down), the traffic should continue to the destination as per previous stable state; i.e. to either a or b as the case was.
I understand an option to achieve cases a and b will be by setting up a separate pool and having a Health Monitor that calls the API, and the iRule on the VIP checking the LB::status of that pool and direct the traffic accordingly. But the challenge I'm facing is how to achieve the case c above.
Any suggestions? Thanks.
Hi Joshy,
solving c.) with native health-monitors sounds challenging.
You would need an "External Monitor" script which CURLs your web service and then stores the current state in a text file as a fallback mechanism for the next probe.
https://devcentral.f5.com/articles/ltm-external-monitors-the-basics
https://devcentral.f5.com/codeshare?sid=395
Cheers, Kai
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